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

◆ AddRange() [1/4]

static MutationResult System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.AddRange ( IEnumerable< KeyValuePair< TKey, TValue > > items,
MutationInput origin,
KeyCollisionBehavior collisionBehavior = KeyCollisionBehavior::ThrowIfValueDifferent )
inlinestaticprivate

Definition at line 1441 of file ImmutableDictionary.cs.

1442 {
1443 Requires.NotNull(items, "items");
1444 int num = 0;
1446 foreach (KeyValuePair<TKey, TValue> item in items)
1447 {
1448 Requires.NotNullAllowStructs(item.Key, "Key");
1449 int hashCode = origin.KeyComparer.GetHashCode(item.Key);
1450 OperationResult result;
1451 HashBucket newBucket = sortedInt32KeyNode.GetValueOrDefault(hashCode).Add(item.Key, item.Value, origin.KeyOnlyComparer, origin.ValueComparer, collisionBehavior, out result);
1452 sortedInt32KeyNode = UpdateRoot(sortedInt32KeyNode, hashCode, newBucket, origin.HashBucketComparer);
1453 if (result == OperationResult.SizeChanged)
1454 {
1455 num++;
1456 }
1457 }
1458 return new MutationResult(sortedInt32KeyNode, num);
1459 }
void Add(TKey key, TValue value)
static SortedInt32KeyNode< HashBucket > UpdateRoot(SortedInt32KeyNode< HashBucket > root, int hashCode, HashBucket newBucket, IEqualityComparer< HashBucket > hashBucketComparer)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.IEqualityComparer.GetHashCode(), System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.MutationInput.HashBucketComparer, System.item, System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.MutationInput.KeyComparer, System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.MutationInput.KeyOnlyComparer, System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.MutationInput.Root, System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.UpdateRoot(), and System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.MutationInput.ValueComparer.