Class ListExtensions
Extension methods for List<T> objects
Namespace: Unity.XRTools.Utils
Syntax
public static class ListExtensions : object
Methods
EnsureCapacity<T>(List<T>, Int32)
Ensure 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 |
| Int32 | capacity | The minimum number of elements the list storage must contain |
Type Parameters
| Name | Description |
|---|---|
| T | The list element type |
Fill<T>(List<T>, Int32)
Fill the list with default objects of type T
Declaration
public static List<T> Fill<T>(this List<T> list, int count)
where T : new()
Parameters
| Type | Name | Description |
|---|---|---|
| List<T> | list | The list |
| Int32 | count | The number of items to fill the list with |
Returns
| Type | Description |
|---|---|
| List<T> | The list that was filled |
Type Parameters
| Name | Description |
|---|---|
| T | The type of objects in this list |