Implement erase() in SortedVector.

Requires vector to be sorted, in order to not bother with recalculating
sortedEnd value.
This commit is contained in:
Bartosz Taudul 2021-11-14 23:54:39 +01:00
parent 710a488af0
commit bb30333947
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -85,6 +85,12 @@ public:
tracy_force_inline void clear() { v.clear(); sortedEnd = 0; } tracy_force_inline void clear() { v.clear(); sortedEnd = 0; }
tracy_force_inline T* erase( T* begin, T* end )
{
assert( is_sorted() );
return v.erase( begin, end );
}
tracy_force_inline void sort() { sort( CompareDefault() ); } tracy_force_inline void sort() { sort( CompareDefault() ); }
tracy_force_inline void ensure_sorted() { if( !is_sorted() ) sort(); } tracy_force_inline void ensure_sorted() { if( !is_sorted() ) sort(); }