com.wallstop-studios.unity-helpers 2.0.0-rc47 → 2.0.0-rc48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -125,7 +125,11 @@
|
|
|
125
125
|
{
|
|
126
126
|
if (dictionary is ConcurrentDictionary<K, V> concurrentDictionary)
|
|
127
127
|
{
|
|
128
|
-
return concurrentDictionary.AddOrUpdate(
|
|
128
|
+
return concurrentDictionary.AddOrUpdate(
|
|
129
|
+
key,
|
|
130
|
+
creator,
|
|
131
|
+
(_, existingValue) => existingValue
|
|
132
|
+
);
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
if (dictionary.TryGetValue(key, out V existing))
|
|
@@ -206,6 +210,14 @@
|
|
|
206
210
|
return new Dictionary<K, V>(dictionary);
|
|
207
211
|
}
|
|
208
212
|
|
|
213
|
+
public static Dictionary<K, V> ToDictionary<K, V>(
|
|
214
|
+
this IReadOnlyDictionary<K, V> dictionary,
|
|
215
|
+
IEqualityComparer<K> comparer
|
|
216
|
+
)
|
|
217
|
+
{
|
|
218
|
+
return new Dictionary<K, V>(dictionary, comparer);
|
|
219
|
+
}
|
|
220
|
+
|
|
209
221
|
public static Dictionary<K, V> ToDictionary<K, V>(
|
|
210
222
|
this IEnumerable<KeyValuePair<K, V>> prettyMuchADictionary
|
|
211
223
|
)
|
|
@@ -213,6 +225,14 @@
|
|
|
213
225
|
return prettyMuchADictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
|
214
226
|
}
|
|
215
227
|
|
|
228
|
+
public static Dictionary<K, V> ToDictionary<K, V>(
|
|
229
|
+
this IEnumerable<KeyValuePair<K, V>> prettyMuchADictionary,
|
|
230
|
+
IEqualityComparer<K> comparer
|
|
231
|
+
)
|
|
232
|
+
{
|
|
233
|
+
return prettyMuchADictionary.ToDictionary(kvp => kvp.Key, kvp => kvp.Value, comparer);
|
|
234
|
+
}
|
|
235
|
+
|
|
216
236
|
public static Dictionary<K, V> ToDictionary<K, V>(
|
|
217
237
|
this IEnumerable<(K, V)> prettyMuchADictionary
|
|
218
238
|
)
|
|
@@ -220,6 +240,14 @@
|
|
|
220
240
|
return prettyMuchADictionary.ToDictionary(kvp => kvp.Item1, kvp => kvp.Item2);
|
|
221
241
|
}
|
|
222
242
|
|
|
243
|
+
public static Dictionary<K, V> ToDictionary<K, V>(
|
|
244
|
+
this IEnumerable<(K, V)> prettyMuchADictionary,
|
|
245
|
+
IEqualityComparer<K> comparer
|
|
246
|
+
)
|
|
247
|
+
{
|
|
248
|
+
return prettyMuchADictionary.ToDictionary(kvp => kvp.Item1, kvp => kvp.Item2, comparer);
|
|
249
|
+
}
|
|
250
|
+
|
|
223
251
|
public static bool ContentEquals<K, V>(
|
|
224
252
|
this IReadOnlyDictionary<K, V> dictionary,
|
|
225
253
|
IReadOnlyDictionary<K, V> other
|