MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / RemoveAtKeepOrder

Method RemoveAtKeepOrder

Source/Engine/Core/Collections/Array.h:655–666  ·  view source on GitHub ↗

Removes the item at the specified index of the collection and keeps order of the items in the collection. The zero-based index of the item to remove.

Source from the content-addressed store, hash-verified

653 /// </summary>
654 /// <param name="index">The zero-based index of the item to remove.</param>
655 void RemoveAtKeepOrder(const int32 index)
656 {
657 ASSERT(index < _count && index >= 0);
658 --_count;
659 T* data = _allocation.Get();
660 if (index < _count)
661 {
662 for (int32 i = index; i < _count; i++)
663 data[i] = MoveTemp(data[i + 1]);
664 }
665 Memory::DestructItems(data + _count, 1);
666 }
667
668 /// <summary>
669 /// Removes the first occurrence of a specific object from the collection.

Callers 15

UpdateMethod · 0.80
RemoveFoliageTypeMethod · 0.80
OnUpdateMethod · 0.80
DeserializeMethod · 0.80
PopEventMethod · 0.80
LoadMethod · 0.80
MergeMethod · 0.80
UpdateMethod · 0.80
InsertMethod · 0.80
OnSceneUnloadingFunction · 0.80
GetStackFramesMethod · 0.80
HandleEventMethod · 0.80

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected