mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1040 from oSumAtrIX/race-condition-fix
Remove calling `.ToArray()` on a `ConcurrentDictionary`
This commit is contained in:
commit
824b7ba329
1 changed files with 1 additions and 1 deletions
|
|
@ -74,7 +74,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
// To delete the images from the data dictionary based on the resizing of the Usage Dictionary
|
||||
// Double Check to avoid concurrent remove
|
||||
if (Data.Count > permissibleFactor * MaxCached)
|
||||
foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key).ToArray())
|
||||
foreach (var key in Data.OrderBy(x => x.Value.usage).Take(Data.Count - MaxCached).Select(x => x.Key))
|
||||
Data.TryRemove(key, out _);
|
||||
semaphore.Release();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue