mirror of
https://github.com/Jetsparrow/antiantiswearingbot.git
synced 2026-01-20 23:16:08 +03:00
16 lines
412 B
C#
16 lines
412 B
C#
using System.Collections.Generic;
|
|
|
|
namespace AntiAntiSwearingBot
|
|
{
|
|
public static class IReadOnlyDictionaryExtensions
|
|
{
|
|
public static TValue GetOrDefault<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dict, TKey key)
|
|
{
|
|
TValue res = default(TValue);
|
|
if (key != null)
|
|
dict.TryGetValue(key, out res);
|
|
return res;
|
|
}
|
|
}
|
|
}
|