using System; using System.Collections.Generic; namespace DebuggingEssentials { public class FastSortedDictionary where T : IComparable where U : IComparable { public Dictionary lookup; public FastList> list; public FastSortedDictionary(int capacity) { lookup = new Dictionary(); list = new FastList>(capacity); } public void Add(T key, U value) { lookup.Add(key, value); list.Add(new ItemHolder(key, value)); } public void Sort(CompareMode compareMode) { ItemHolder.compareMode = compareMode; Array.Sort(list.items, 0, list.Count); } public void Clear() { lookup.Clear(); list.Clear(); } } }