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

◆ GetHashCodeCore() [7/7]

int System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.GetHashCodeCore ( IEqualityComparer comparer)
inlineprivate

Definition at line 2040 of file ValueTuple.cs.

2041 {
2042 if (!((object)Rest is IValueTupleInternal { Length: var length } valueTupleInternal))
2043 {
2044 return HashCode.Combine(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7));
2045 }
2046 int hashCode = valueTupleInternal.GetHashCode(comparer);
2047 if (length >= 8)
2048 {
2049 return hashCode;
2050 }
2051 switch (8 - length)
2052 {
2053 case 1:
2054 return HashCode.Combine(comparer.GetHashCode(Item7), hashCode);
2055 case 2:
2056 return HashCode.Combine(comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2057 case 3:
2058 return HashCode.Combine(comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2059 case 4:
2060 return HashCode.Combine(comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2061 case 5:
2062 return HashCode.Combine(comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2063 case 6:
2064 return HashCode.Combine(comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2065 case 7:
2066 case 8:
2067 return HashCode.Combine(comparer.GetHashCode(Item1), comparer.GetHashCode(Item2), comparer.GetHashCode(Item3), comparer.GetHashCode(Item4), comparer.GetHashCode(Item5), comparer.GetHashCode(Item6), comparer.GetHashCode(Item7), hashCode);
2068 default:
2069 return -1;
2070 }
2071 }
int ITuple. Length
Definition ValueTuple.cs:14

References System.comparer, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item1, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item2, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item3, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item4, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item5, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item6, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Item7, System.length, System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Length, and System.ValueTuple< T1, T2, T3, T4, T5, T6, T7, TRest >.Rest.