IRC parsing, tokenization, and state handling in C#
1namespace IRCStates;
2
3public static class Extensions
4{
5 /// <summary>
6 /// Update the dictionary with <see cref="other"/>'s keys and values
7 /// </summary>
8 /// <param name="dict"></param>
9 /// <param name="other"></param>
10 /// <typeparam name="TKey"></typeparam>
11 /// <typeparam name="TValue"></typeparam>
12 public static void UpdateWith<TKey, TValue>(this Dictionary<TKey, TValue> dict, Dictionary<TKey, TValue> other)
13 {
14 if (dict == null || other == null || !other.Any())
15 {
16 return;
17 }
18
19 foreach (var v in other)
20 {
21 dict[v.Key] = v.Value;
22 }
23 }
24}