using System.Collections.Generic; namespace Semmle.Util { public static class DictionaryExtensions { /// /// Adds another element to the list for the given key in this /// dictionary. If a list does not already exist, a new list is /// created. /// public static void AddAnother(this Dictionary> dict, T1 key, T2 element) where T1 : notnull { if (!dict.TryGetValue(key, out var list)) { list = new List(); dict[key] = list; } list.Add(element); } } }