diff --git a/Util.DoubleKeyDictionary/Util.DoubleKeyDictionary/DoubleKeyDictionary.cs b/Util.DoubleKeyDictionary/Util.DoubleKeyDictionary/DoubleKeyDictionary.cs index f5c3166..15a2a00 100644 --- a/Util.DoubleKeyDictionary/Util.DoubleKeyDictionary/DoubleKeyDictionary.cs +++ b/Util.DoubleKeyDictionary/Util.DoubleKeyDictionary/DoubleKeyDictionary.cs @@ -33,6 +33,18 @@ public void Add(K key1, T key2, V value) OuterDictionary.Add(key1, m_innerDictionary); } } + + public void Remove(K key1, T key2) + { + if (OuterDictionary.ContainsKey(key1)) { + if (OuterDictionary[key1].ContainsKey(key2)) { + OuterDictionary[key1].Remove(key2); + if (OuterDictionary[key1].Count == 0) { + OuterDictionary.Remove(key1); + } + } + } + } public V this[K index1, T index2] {