From a0fbcf83c57d15bf4bbdd2f18a8b8d539e3e4a1a Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 14 May 2020 02:10:04 -0400 Subject: Implement lots of things --- IrcStates/Extensions.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'IrcStates/Extensions.cs') diff --git a/IrcStates/Extensions.cs b/IrcStates/Extensions.cs index dde0edb..e604928 100644 --- a/IrcStates/Extensions.cs +++ b/IrcStates/Extensions.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -28,5 +29,12 @@ namespace IrcStates ? Delegate.CreateDelegate(getType(types.ToArray()), methodInfo) : Delegate.CreateDelegate(getType(types.ToArray()), target, methodInfo); } + + public static void Update(this Dictionary dict, Dictionary other) + { + if (dict == null || other == null || !other.Any()) return; + + foreach (var (key, value) in other) dict[key] = value; + } } } -- cgit 1.4.1