internal override CachingComparer <TElement> GetComparer(CachingComparer <TElement>?childComparer) { CachingComparer <TElement> cmp = childComparer == null ? new CachingComparer <TElement, TKey>(_keySelector, _comparer, _descending) : new CachingComparerWithChild <TElement, TKey>(_keySelector, _comparer, _descending, childComparer); return(_parent != null?_parent.GetComparer(cmp) : cmp); }
public CachingComparerWithChild(Func <TElement, TKey> keySelector, IComparer <TKey> comparer, bool descending, CachingComparer <TElement> child) : base(keySelector, comparer, descending) { _child = child; }
public HackyHashSet(IEnumerable <T> coll, IEqualityComparer <T> comparer = null) { this.cachingComparer = new CachingComparer(comparer ?? EqualityComparer <T> .Default); this.set = new HashSet <T>(coll, cachingComparer); }