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

◆ TrimExcess()

void System.Collections.Generic.HashSet< T >.TrimExcess ( )
inline

Definition at line 843 of file HashSet.cs.

844 {
845 int count = Count;
846 int prime = HashHelpers.GetPrime(count);
848 int num = ((entries != null) ? entries.Length : 0);
849 if (prime >= num)
850 {
851 return;
852 }
853 int count2 = _count;
854 _version++;
857 int num2 = 0;
858 for (int i = 0; i < count2; i++)
859 {
860 int hashCode = entries[i].HashCode;
861 if (entries[i].Next >= -1)
862 {
865 ref int bucketRef = ref GetBucketRef(hashCode);
867 bucketRef = num2 + 1;
868 num2++;
869 }
870 }
871 _count = count;
872 _freeCount = 0;
873 }
ref int GetBucketRef(int hashCode)
Definition HashSet.cs:321

References System.Collections.Generic.HashSet< T >._count, System.Collections.Generic.HashSet< T >._entries, System.Collections.Generic.HashSet< T >._freeCount, System.Collections.Generic.HashSet< T >._version, System.count, System.Collections.Generic.HashSet< T >.Count, System.Runtime.Serialization.Dictionary, System.Collections.Generic.HashSet< T >.GetBucketRef(), System.Collections.HashHelpers.GetPrime(), and System.Collections.Generic.HashSet< T >.Initialize().

Referenced by System.Collections.Generic.HashSet< T >.HashSet().