Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/TArray
Description
Removes the first occurrence of the specified item in the array. This version is much more efficient O(Count) instead of O(ArrayNum), but does not preserve the order
| Name | RemoveSingleSwap |
| Type | function |
| Header File | /Engine/Source/Runtime/Core/Public/Containers/Array.h |
| Include Path | #include "Containers/Array.h" |
SizeType RemoveSingleSwap
(
const ElementType & Item,
EAllowShrinking AllowShrinking
)
The number of items removed. For RemoveSingleItem, this is always either 0 or 1.
Parameters
| Name | Remarks |
|---|---|
| Item | The item to remove |
| AllowShrinking | (Optional) By default, arrays with large amounts of slack will automatically shrink. Use FNonshrinkingAllocator or pass EAllowShrinking::No to prevent this. |
See Also
-
Add
-
Insert
-
RemoveSwap