From bb3033394708b888623a95df25a5e596b0c63a3a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 14 Nov 2021 23:54:39 +0100 Subject: [PATCH] Implement erase() in SortedVector. Requires vector to be sorted, in order to not bother with recalculating sortedEnd value. --- server/TracySortedVector.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/TracySortedVector.hpp b/server/TracySortedVector.hpp index 15d20626..39293d60 100644 --- a/server/TracySortedVector.hpp +++ b/server/TracySortedVector.hpp @@ -85,6 +85,12 @@ public: 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 ensure_sorted() { if( !is_sorted() ) sort(); }