Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a typo in a variable name #77062

Merged
merged 1 commit into from
Oct 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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