Ejemplo n.º 1
0
        private void ResizeBuckets()
        {
            int newSize = InternalSetHelpers.GetNextPrime(this.filledBucketsCount);

            Node[] temp = this.hashBuckets;
            this.hashBuckets        = new Node[newSize];
            this.filledBucketsCount = 0;

            foreach (var item in temp)
            {
                Node current = item;

                while (current != null)
                {
                    this.Add(current);
                    current = current.NextHash;
                }
            }
        }
Ejemplo n.º 2
0
 private static int GetHashCodeConsideringNulls(T item)
 {
     return(item == null ? 0 : InternalSetHelpers.GetAbsoluteHashCode(item.GetHashCode()));
 }