summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-11-02 14:35:01 +0100
committerEike Rathke <erack@redhat.com>2015-11-02 18:07:39 +0100
commit5bcc5a690f9707464195483c400427d9ccd6d8dc (patch)
tree659f9f0243fae97288ec7d2157b2d8568ba4fe05
parent4b3b605f3334a41057f565866de37bd14369a55e (diff)
avoid construction of ScRefCellValue with default ctor, tdf#95419 related
... to just assign a new value, which takes a significant amount of time (~13% of ScTable::ValidQuery()) in ScRefCellValue::operator=() due to its implementation using a temporary and swap. Change-Id: Ia205850e10c5fa9083eec5fb7563d98561b52462
-rw-r--r--sc/source/core/data/table3.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a95dd68c0094..861ac3de522b 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2625,12 +2625,9 @@ bool ScTable::ValidQuery(
const ScQueryEntry& rEntry = *it;
SCCOL nCol = static_cast<SCCOL>(rEntry.nField);
- // we can only handle one single direct query
- ScRefCellValue aCell;
- if (pCell && it == itBeg)
- aCell = *pCell;
- else
- aCell = GetCellValue(nCol, nRow);
+ // We can only handle one single direct query passed as a known pCell,
+ // subsequent queries have to obtain the cell.
+ ScRefCellValue aCell( (pCell && it == itBeg) ? *pCell : GetCellValue(nCol, nRow));
std::pair<bool,bool> aRes(false, false);