a740176009
This requires 2 fixes (*) First, we are deleting from the front of a block in the mdds storage, so apply a similar patch to mdds to the previous improvement, (*) Then, we end up with an O(n^2) situation in ScRangesList::Join. But we are only displaying this data, and in fact, we only display the first 1000 ranges anyway, so just clamp the list to 1000 entries, and pass a flag up to the dialog so that we can report that we stopped counting. (*) I had to tweak the testSharedStringPool unit test, since we are not actually clearing the underlying mdds storage, the reference counts do not drop until we have removed all the elements in that block of mdds storage (because then the entire block is destructed, including the not-yet destructed elements) Change-Id: I2c998f81dfb46453a48fce1254fd253d299d12b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
18 lines
671 B
Diff
18 lines
671 B
Diff
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
|