Skip to content

Commit 86f6f99

Browse files
committed
update to use concurrent dictionary
1 parent 086c5d0 commit 86f6f99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ namespace Flow.Launcher.Infrastructure.Image
1414
public static class ImageLoader
1515
{
1616
private static readonly ImageCache ImageCache = new ImageCache();
17-
private static readonly ConcurrentDictionary<string, string> _guidToKey = new ConcurrentDictionary<string, string>();
17+
private static BinaryStorage<ConcurrentDictionary<string, int>> _storage;
1818
private static readonly ConcurrentDictionary<string, string> GuidToKey = new ConcurrentDictionary<string, string>();
19-
private static BinaryStorage<Dictionary<string, int>> _storage;
2019
private static IImageHashGenerator _hashGenerator;
2120
private static bool EnableImageHash = true;
2221

@@ -33,7 +32,7 @@ public static class ImageLoader
3332

3433
public static void Initialize()
3534
{
36-
_storage = new BinaryStorage<Dictionary<string, int>>("Image");
35+
_storage = new BinaryStorage<ConcurrentDictionary<string, int>>("Image");
3736
_hashGenerator = new ImageHashGenerator();
3837

3938
ImageCache.Usage = LoadStorageToConcurrentDictionary();
@@ -70,7 +69,7 @@ private static ConcurrentDictionary<string, int> LoadStorageToConcurrentDictiona
7069
{
7170
lock(_storage)
7271
{
73-
var loaded = _storage.TryLoad(new Dictionary<string, int>());
72+
var loaded = _storage.TryLoad(new ConcurrentDictionary<string, int>());
7473

7574
return new ConcurrentDictionary<string, int>(loaded);
7675
}

0 commit comments

Comments
 (0)