Skip to content

Commit

Permalink
Fixed a typo in a variable name (#77062)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall authored Oct 15, 2022
1 parent bd3c1a4 commit 0ef6f9e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -453,17 +453,17 @@ internal void Grow(int capacity)
{
Debug.Assert(_items.Length < capacity);

int newcapacity = _items.Length == 0 ? DefaultCapacity : 2 * _items.Length;
int newCapacity = _items.Length == 0 ? DefaultCapacity : 2 * _items.Length;

// Allow the list to grow to maximum possible capacity (~2G elements) before encountering overflow.
// Note that this check works even when _items.Length overflowed thanks to the (uint) cast
if ((uint)newcapacity > Array.MaxLength) newcapacity = Array.MaxLength;
if ((uint)newCapacity > Array.MaxLength) newCapacity = Array.MaxLength;

// If the computed capacity is still less than specified, set to the original argument.
// Capacities exceeding Array.MaxLength will be surfaced as OutOfMemoryException by Array.Resize.
if (newcapacity < capacity) newcapacity = capacity;
if (newCapacity < capacity) newCapacity = capacity;

Capacity = newcapacity;
Capacity = newCapacity;
}

public bool Exists(Predicate<T> match)
Expand Down

0 comments on commit 0ef6f9e

Please sign in to comment.