diff options
author | Eike Rathke <erack@redhat.com> | 2016-09-28 13:16:11 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-09-28 13:16:53 +0200 |
commit | e439058541cd02937cf43f399fef8767bd3d4996 (patch) | |
tree | d647807a5d77e7232c2a35144738a043392927e4 | |
parent | Fix minor issue in importing cell styles (diff) | |
download | core-e439058541cd02937cf43f399fef8767bd3d4996.tar.gz core-e439058541cd02937cf43f399fef8767bd3d4996.zip |
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.cxx | 5 |
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++) |