ircsharp/IRCStates/Extensions.cs

16 lines
407 B
C#

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;
}
}
}