summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-01-16 21:54:24 +0100
committerEike Rathke <erack@redhat.com>2015-01-16 21:57:30 +0100
commit15e802fabbfff047c1a8d768dea8fc04a2f82a49 (patch)
tree035e62d059fdda754fb4369ab2fffddb34883631 /sc/source
parent4bd05b8abc801714e2bac1a9b239fa625de1178c (diff)
replace decrementing loop with -=
This could save a million iterations ... Change-Id: I44fb228b951580bbeb5df5f6ec7be933077776ff
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column4.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index b997948d0f0b..a162ca7c3cda 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -1476,8 +1476,9 @@ void ScColumn::EndListeningGroup( sc::EndListeningContext& rCxt, SCROW nRow )
// Move back to the top cell.
SCROW nTopDelta = (*pp)->aPos.Row() - xGroup->mpTopCell->aPos.Row();
- for (SCROW i = 0; i < nTopDelta; ++i)
- --pp;
+ assert(nTopDelta >= 0);
+ if (nTopDelta > 0)
+ pp -= nTopDelta;
// Set the needs listening flag to all cells in the group.
assert(*pp == xGroup->mpTopCell);
@@ -1505,8 +1506,9 @@ void ScColumn::SetNeedsListeningGroup( SCROW nRow )
// Move back to the top cell.
SCROW nTopDelta = (*pp)->aPos.Row() - xGroup->mpTopCell->aPos.Row();
- for (SCROW i = 0; i < nTopDelta; ++i)
- --pp;
+ assert(nTopDelta >= 0);
+ if (nTopDelta > 0)
+ pp -= nTopDelta;
// Set the needs listening flag to all cells in the group.
assert(*pp == xGroup->mpTopCell);