Skip to content

Commit

Permalink
add EzyDictionaries.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
tvd12 committed Nov 8, 2023
1 parent 195dea1 commit c9fc8fb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions util/EzyDictionaries.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;

namespace com.tvd12.ezyfoxserver.client.util
{
public sealed class EzyDictionaries
{
private EzyDictionaries()
{
}

public static V getOrDefault<K, V>(
IDictionary<K, V> dict,
K key,
V defaultValue
)
{
return dict.ContainsKey(key) ? dict[key] : defaultValue;
}
}
}

0 comments on commit c9fc8fb

Please sign in to comment.