We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d84088c commit 42783c0Copy full SHA for 42783c0
src/Files.Shared/Extensions/LinqExtensions.cs
@@ -33,7 +33,7 @@ public static class LinqExtensions
33
if (!dictionary.ContainsKey(key))
34
{
35
if (defaultValue is TValue value)
36
- dictionary.Add(key, value);
+ dictionary.TryAdd(key, value);
37
38
return defaultValue;
39
}
@@ -53,16 +53,8 @@ public static class LinqExtensions
53
54
var defaultValue = defaultValueFunc();
55
if (defaultValue is Task<TValue?> value)
56
- {
57
- if (dictionary is ConcurrentDictionary<TKey, Task<TValue?>> cDict)
58
59
- cDict.TryAdd(key, value);
60
- }
61
- else
62
63
64
65
+
66
67
68
return dictionary[key];
0 commit comments