Skip to content

Commit

Permalink
obsolete AddOrSet
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 16, 2024
1 parent 55644b1 commit 750973a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/Akka/Util/Internal/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ public static string BetweenDoubleQuotes(this string self)
/// <param name="hash">TBD</param>
/// <param name="key">TBD</param>
/// <param name="value">TBD</param>
[Obsolete("Use the dictionary setter directly")]
public static void AddOrSet<TKey, TValue>(this IDictionary<TKey, TValue> hash, TKey key, TValue value)
{
if (hash.ContainsKey(key))
hash[key] = value;
else
hash.Add(key,value);
hash[key] = value;
}

/// <summary>
Expand Down Expand Up @@ -146,7 +144,7 @@ public static TValue GetOrElse<TKey, TValue>(this IDictionary<TKey, TValue> hash
/// <returns>TBD</returns>
public static IDictionary<TKey, TValue> AddAndReturn<TKey, TValue>(this IDictionary<TKey, TValue> hash, TKey key, TValue value)
{
hash.AddOrSet(key, value);
hash[key] = value;
return hash;
}

Expand Down

0 comments on commit 750973a

Please sign in to comment.