diff options
Diffstat (limited to 'IRCStates/Extensions.cs')
-rw-r--r-- | IRCStates/Extensions.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/IRCStates/Extensions.cs b/IRCStates/Extensions.cs new file mode 100644 index 0000000..c807dbb --- /dev/null +++ b/IRCStates/Extensions.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Linq; + +namespace IRCStates +{ + public static class Extensions + { + public static void UpdateWith<TKey, TValue>(this Dictionary<TKey, TValue> dict, Dictionary<TKey, TValue> other) + { + if (dict == null || other == null || !other.Any()) return; + + foreach (var (key, value) in other) dict[key] = value; + } + } +} |