DictionaryExtensions - fix AddOrUpdate (missing 'else')

This commit is contained in:
John Colvin committed 2018-12-12 14:23:39 -06:00
1 parent 6091a7e32b
commit f97ba558b0
1 file changed
+1 -1
@@ -12,7 +12,7 @@ namespace System.Collections.Generic {
public static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> add_value_factory, Func<TKey, TValue, TValue> update_value) {
if (!dictionary.TryGetValue(key, out TValue value))
dictionary.Add(key, add_value_factory(key));
dictionary[key] = update_value(key, value);
else dictionary[key] = update_value(key, value);
}
public static TValue GetOrAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, Func<TKey, TValue> add_value_factory) {