Class FixedList4096BytesExtensions
Provides extension methods for FixedList4096Bytes.
Namespace: Unity.Collections
Assembly: Unity.Collections.dll
Syntax
public static class FixedList4096BytesExtensions
Methods
Contains<T, U>(ref FixedList4096Bytes<T>, U)
Returns true if a particular value is present in this list.
Declaration
public static bool Contains<T, U>(this ref FixedList4096Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList4096Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
bool | True if the value is present in this list. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
IndexOf<T, U>(ref FixedList4096Bytes<T>, U)
Finds the index of the first occurrence of a particular value in this list.
Declaration
public static int IndexOf<T, U>(this ref FixedList4096Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList4096Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
int | The index of the first occurrence of the value. Returns -1 if no occurrence is found. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
RemoveSwapBack<T, U>(ref FixedList4096Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool RemoveSwapBack<T, U>(this ref FixedList4096Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList4096Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
bool | Returns true if the item is removed. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
Remarks
If a value is removed, the last element of the list is copied to overwrite the removed value, and the list's length is decremented by one.
This is cheaper than Remove<T, U>(ref FixedList4096Bytes<T>, U), but the order of the remaining elements is not preserved.
Remove<T, U>(ref FixedList4096Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool Remove<T, U>(this ref FixedList4096Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList4096Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
bool | True if the value was found and removed. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
Remarks
If a value is removed, all elements after it are shifted down by one, and the list's length is decremented by one.
If you don't need to preserve the order of the remaining elements, RemoveSwapBack<T, U>(ref FixedList4096Bytes<T>, U) is a cheaper alternative.