diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-02-23 13:54:10 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-24 09:46:35 +0100 |
commit | cbfc211c50daef5b9b477d0731d48982898d40b7 (patch) | |
tree | f29eef58db04f401a3b2d4051f36096bb8549bad | |
parent | 57782b9a56309dcc3bb402b17691d4f46706ca73 (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>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111438
-rw-r--r-- | sc/source/core/data/column3.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index f1a621a985b5..69213b7fedbc 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -979,7 +979,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); |