diff options
author | Serge Krot <Serge.Krot@cib.de> | 2017-11-23 11:13:35 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-23 22:19:39 +0100 |
commit | 4c5a19f9cf98fb2b38ee6b4b35f4074499270353 (patch) | |
tree | 8b6ce2cba20c0325c66d2ba5780994eb35d18572 /sc/source/ui/view | |
parent | 723aae2d5b800be159e423e3a0e8f3cc282b0020 (diff) |
related tdf#108757 small enhancements for speed up
- no strings reallocation
- faster for-loops
Change-Id: I98a355eb3bcb48219afd6334615c9c092ed1a352
Reviewed-on: https://gerrit.libreoffice.org/45142
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/pfuncache.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index daf593fdbb3d..c738d4920f79 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -163,7 +163,8 @@ SCTAB ScPrintFuncCache::GetTabForPage( long nPage ) const long ScPrintFuncCache::GetTabStart( SCTAB nTab ) const { long nRet = 0; - for ( SCTAB i=0; i<nTab&& i < static_cast<SCTAB>(nPages.size()); i++ ) + const SCTAB maxIndex = std::min(nTab, static_cast<SCTAB>(nPages.size())); + for ( SCTAB i=0; i<maxIndex; i++ ) nRet += nPages[i]; return nRet; } |