summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-09-28 13:16:11 +0200
committerEike Rathke <erack@redhat.com>2016-09-28 13:16:53 +0200
commite439058541cd02937cf43f399fef8767bd3d4996 (patch)
treed647807a5d77e7232c2a35144738a043392927e4
parenta995e219a4553202f24d0da59aa22c1dd5743dfc (diff)
sc-perf: avoid second call to ScAttrArray::Search(), tdf#87101 related
In that scenario, of 36791233 calls only 9217 were necessary as most times nRow2 equals nRow1. Change-Id: I14228d065175addee76b9142c98110efe59701e7
-rw-r--r--sc/source/core/data/attarray.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 0f51713fae9f..fb90fb435cb4 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1199,7 +1199,10 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, HasAttrFlags nMask ) cons
SCSIZE nStartIndex;
SCSIZE nEndIndex;
Search( nRow1, nStartIndex );
- Search( nRow2, nEndIndex );
+ if (nRow1 != nRow2)
+ Search( nRow2, nEndIndex );
+ else
+ nEndIndex = nStartIndex;
bool bFound = false;
for (SCSIZE i=nStartIndex; i<=nEndIndex && !bFound; i++)