Method EnsureCapacity
EnsureCapacity<T>(List<T>, int)
Ensures that the capacity of this list is at least as large the given value.
Declaration
public static void EnsureCapacity<T>(this List<T> list, int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | list | The list whose capacity will be ensured. |
| int | capacity | The minimum number of elements the list storage must contain. |
Type Parameters
| Name | Description |
|---|---|
| T | The list element type. |
Remarks
Increases the capacity of the list, if necessary, but doe not decrease the capacity if it already exceeds the specified value.