summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodolfo Ribeiro Gomes <rodolforg@gmail.com>2012-12-19 12:50:59 -0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-19 16:54:33 +0100
commit94deef9b29346a027b88f934b0ca83ef6a8bf846 (patch)
tree13b268720d9f44077dfee6373e6c1179ce805528
parent978aaaf6b422e11ffc55b16cd004ab27a3adc73b (diff)
Little optimisation when getting the whole range
Just avoid "if" statement every iteration since the condition is true only at the first run Change-Id: I0f2f93196b2b28d457dfbb7b18f568abb45adcbb
-rw-r--r--sc/source/core/data/clipparam.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx
index 37094b6f0c3f..002e0c4ee264 100644
--- a/sc/source/core/data/clipparam.cxx
+++ b/sc/source/core/data/clipparam.cxx
@@ -113,16 +113,13 @@ SCROW ScClipParam::getPasteRowSize()
ScRange ScClipParam::getWholeRange() const
{
ScRange aWhole;
- bool bFirst = true;
- for ( size_t i = 0, n = maRanges.size(); i < n; ++i )
+ size_t nRangeSize = maRanges.size();
+ if (nRangeSize < 1)
+ return aWhole;
+ aWhole = *maRanges[0];
+ for ( size_t i = 1; i < nRangeSize; ++i )
{
const ScRange* p = maRanges[i];
- if (bFirst)
- {
- aWhole = *p;
- bFirst = false;
- continue;
- }
if (aWhole.aStart.Col() > p->aStart.Col())
aWhole.aStart.SetCol(p->aStart.Col());