Skip to content

Commit dd913f7

Browse files
committed
Small change
1 parent 663c925 commit dd913f7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Include/Containers/Array.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ namespace Rift
441441
return lastSize - Size();
442442
}
443443

444+
// Removes an item assuming the array is sorted
445+
template<typename SortPredicate = TLess<>>
446+
i32 RemoveSorted(
447+
const Type& item, SortPredicate sortPredicate = {}, const bool shouldShrink = true)
448+
{
449+
return i32(RemoveAt(FindSortedEqual(item, sortPredicate)));
450+
}
451+
444452
/**
445453
* Delete item at index
446454
* @return true if removed

0 commit comments

Comments
 (0)