Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Resize() [2/2]

void System.Collections.Generic.HashSet< T >.Resize ( int newSize,
bool forceNewHashCodes )
inlineprivate

Definition at line 807 of file HashSet.cs.

808 {
809 Entry[] array = new Entry[newSize];
810 int count = _count;
811 Array.Copy(_entries, array, count);
812 if (!typeof(T).IsValueType && forceNewHashCodes)
813 {
814 _comparer = (IEqualityComparer<T>)((NonRandomizedStringEqualityComparer)_comparer).GetRandomizedEqualityComparer();
815 for (int i = 0; i < count; i++)
816 {
818 if (reference.Next >= -1)
819 {
821 }
822 }
824 {
825 _comparer = null;
826 }
827 }
828 _buckets = new int[newSize];
829 _fastModMultiplier = HashHelpers.GetFastModMultiplier((uint)newSize);
830 for (int j = 0; j < count; j++)
831 {
833 if (reference2.Next >= -1)
834 {
835 ref int bucketRef = ref GetBucketRef(reference2.HashCode);
837 bucketRef = j + 1;
838 }
839 }
840 _entries = array;
841 }
IEqualityComparer< T > _comparer
Definition HashSet.cs:105
ref int GetBucketRef(int hashCode)
Definition HashSet.cs:321

References System.Collections.Generic.HashSet< T >._buckets, System.Collections.Generic.HashSet< T >._comparer, System.Collections.Generic.HashSet< T >._count, System.Collections.Generic.HashSet< T >._entries, System.Collections.Generic.HashSet< T >._fastModMultiplier, System.array, System.Array.Copy(), System.count, System.Default, System.Runtime.Serialization.Dictionary, System.Collections.Generic.HashSet< T >.GetBucketRef(), System.Collections.HashHelpers.GetFastModMultiplier(), System.Collections.Generic.IEqualityComparer< in T >.GetHashCode(), and System.newSize.