about summary refs log tree commit diff
path: root/IrcStates/Extensions.cs
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-05-14 02:10:04 -0400
committerBen Harris <ben@tilde.team>2020-05-14 02:10:04 -0400
commita0fbcf83c57d15bf4bbdd2f18a8b8d539e3e4a1a (patch)
tree2399e5b4f920a10917451069d808cfc4d2eb259b /IrcStates/Extensions.cs
parent023e29ab75f1f413f918346edaddafdf8b1df5ee (diff)
Implement lots of things
Diffstat (limited to 'IrcStates/Extensions.cs')
-rw-r--r--IrcStates/Extensions.cs8
1 files changed, 8 insertions, 0 deletions
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<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;
+        }
     }
 }