diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-10-08 18:02:30 +0200 |
---|---|---|
committer | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2018-10-08 20:45:08 +0200 |
commit | bc9385c71e780f4dca5c54b8e817faae43c30d18 (patch) | |
tree | 1a71546b720ea070e5cbea0478466bdaa89a2a6d /sc | |
parent | 9ed8a1bfffd608b31badeae5341ebf0b48501419 (diff) |
cppcheck: variableScope and fix index types
Change-Id: I045b4d84e0ad07a98523b91fc7203bfd422b3529
Reviewed-on: https://gerrit.libreoffice.org/61541
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/markarr.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index f9c5fdc3299a..7bdff0fcf989 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -63,13 +63,13 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const { if (pData) { - long nHi = static_cast<long>(nCount) - 1; - long i = 0; - long nLo = 0; + assert(nCount > 0); + SCSIZE nHi = nCount - 1; + SCSIZE nLo = 0; while ( nLo <= nHi ) { - i = (nLo + nHi) / 2; + SCSIZE i = (nLo + nHi) / 2; if (pData[i].nRow < nRow) { @@ -84,7 +84,7 @@ bool ScMarkArray::Search( SCROW nRow, SCSIZE& nIndex ) const else { // found - nIndex=static_cast<SCSIZE>(i); + nIndex=i; return true; } } |