using System; using System.Collections.Generic; namespace DebuggingEssentials { public class FastSortedHashSet where T : IComparable { public HashSet lookup; public FastList list; public FastSortedHashSet(int capacity) { lookup = new HashSet(); list = new FastList(capacity); } public void Add(T item) { lookup.Add(item); list.Add(item); } public void Sort() { Array.Sort(list.items, 0, list.Count); } public void Clear() { lookup.Clear(); list.Clear(); } } public class FastSortedHashSet where U : IComparable { public HashSet lookup; public FastList list; public FastSortedHashSet(int capacity) { lookup = new HashSet(); list = new FastList(capacity); } public void Add(T lookupItem, U listItem) { lookup.Add(lookupItem); list.Add(listItem); } public void Sort() { Array.Sort(list.items, 0, list.Count); } public void Clear() { lookup.Clear(); list.Clear(); } } }