summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-02-23 13:54:10 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-02-23 17:47:53 +0100
commit13be1527c0e5a5c13d73e73af8c1bc7df0a2f603 (patch)
tree556ad96654567553748b5aa4ddb9d63533a2b056 /sc/source/core/data
parentf826d72cdf8bd243bba5b8b4f3ebdd5c3a3375a3 (diff)
delete from mdds in reverse order (tdf#139820)
This is a more elegant solution from Noel, compared to my previous commit. Deleting in reverse order means the underlying std::vector used by mdds does not have possible to-be-deleted items to move around that forward order would have. Change-Id: I31f0774e302308bcb70595cb899c977ee5966c7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111395 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column3.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 14d1ebdc09c4..edf99f02bef5 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -978,7 +978,8 @@ void ScColumn::DeleteCells(
aFunc.getSpans().getSpans(aSpans);
// Delete the cells for real.
- std::for_each(aSpans.begin(), aSpans.end(), EmptyCells(rBlockPos, *this));
+ // tdf#139820: Deleting in reverse order is more efficient.
+ std::for_each(aSpans.rbegin(), aSpans.rend(), EmptyCells(rBlockPos, *this));
CellStorageModified();
aFunc.getSpans().swap(rDeleted);