summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2023-10-19 15:15:33 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-20 17:17:54 +0200
commit2cbf54efab073d9147e2d6c627c8ff3726de8578 (patch)
tree2fa3972db8c045f2abdede2e187dcd23762cfb33 /sc
parentdab91084b576410f0d76b4da5f5479bb1578ec0c (diff)
sc: perf: avoid construction of collector for empty note columns.
It is extremely common to have empty note columns; so shorten this path profile in: cool#7334 Change-Id: Ibfd550be1a5e8e98df8b4ede0d018c4f85300648 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158158 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column4.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index a1423b2e1c67..be0fc4f201c3 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -856,7 +856,9 @@ public:
void ScColumn::GetAllNoteEntries( std::vector<sc::NoteEntry>& rNotes ) const
{
- std::for_each(maCellNotes.begin(), maCellNotes.end(), NoteEntryCollector(rNotes, nTab, nCol, 0, GetDoc().MaxRow()));
+ if (HasCellNotes())
+ std::for_each(maCellNotes.begin(), maCellNotes.end(),
+ NoteEntryCollector(rNotes, nTab, nCol, 0, GetDoc().MaxRow()));
}
void ScColumn::GetNotesInRange(SCROW nStartRow, SCROW nEndRow,