summaryrefslogtreecommitdiff
path: root/external/mdds/speedup-erase-2.patch
blob: 2affa48134203b263420aa1fffa89acfd51f5074 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff -ur include/mdds/multi_type_vector/types.hpp include/mdds/multi_type_vector/types.hpp
--- include/mdds/multi_type_vector/types.hpp	2022-09-02 15:16:14.811400565 +0200
+++ include/mdds/multi_type_vector/types.hpp	2022-09-02 15:18:26.951249322 +0200
@@ -253,7 +253,13 @@
     
     iterator erase( iterator first, iterator last )
     {
-        return m_vec.erase( first, last );
+        if (first == m_vec.begin() + m_removedFront)
+        {
+            m_removedFront = last - m_vec.begin();
+            return m_vec.begin() + m_removedFront;
+        }
+        else
+            return m_vec.erase( first, last );
     }
     
     size_type capacity() const