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

◆ Union() [1/2]

Implements System.Collections.Immutable.IImmutableSet< T >.

Definition at line 1096 of file ImmutableSortedSet.cs.

1097 {
1098 Requires.NotNull(other, "other");
1100 {
1101 if (other2.IsEmpty)
1102 {
1103 return this;
1104 }
1105 if (IsEmpty)
1106 {
1107 return other2;
1108 }
1109 if (other2.Count > Count)
1110 {
1111 return other2.Union(this);
1112 }
1113 }
1114 if (IsEmpty || (other.TryGetCount(out var count) && (float)(Count + count) * 0.15f > (float)Count))
1115 {
1116 return LeafToRootRefill(other);
1117 }
1118 return UnionIncremental(other);
1119 }
ImmutableSortedSet< T > LeafToRootRefill(IEnumerable< T > addedItems)
ImmutableSortedSet< T > UnionIncremental(IEnumerable< T > items)
static bool TryCastToImmutableSortedSet(IEnumerable< T > sequence, [NotNullWhen(true)] out ImmutableSortedSet< T > other)

References System.Collections.Immutable.ImmutableSortedSet< T >.Count, System.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Collections.Immutable.ImmutableSortedSet< T >.IsEmpty, System.Collections.Immutable.ImmutableSortedSet< T >.KeyComparer, System.Collections.Immutable.ImmutableSortedSet< T >.LeafToRootRefill(), System.other, System.Collections.Immutable.ImmutableSortedSet< T >.TryCastToImmutableSortedSet(), and System.Collections.Immutable.ImmutableSortedSet< T >.UnionIncremental().

Referenced by System.Collections.Immutable.ImmutableSortedSet< T >.Union().