diff options
author | Neil <nyamatongwe@gmail.com> | 2022-07-28 16:42:17 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-07-28 16:42:17 +1000 |
commit | 2a5ffea80aacbd6353f4462300e42c8d55ac19e9 (patch) | |
tree | 057a1db8c8b98e9b81a1343a532062b7a6c7d219 | |
parent | f01ec460364301c3307d0fa68ce3e177c41626ce (diff) | |
download | scintilla-mirror-2a5ffea80aacbd6353f4462300e42c8d55ac19e9.tar.gz |
Use extra consts to avoid 32 to 64-bit widening warnings in headers.
This change wouldn't be worthwhile in implementation files but warnings in
headers obscure more important diagnostics.
-rw-r--r-- | src/RunStyles.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index ed4ecc216..6d43e6085 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -71,7 +71,8 @@ void RunStyles<DISTANCE, STYLE>::RemoveRunIfEmpty(DISTANCE run) { template <typename DISTANCE, typename STYLE> void RunStyles<DISTANCE, STYLE>::RemoveRunIfSameAsPrevious(DISTANCE run) { if ((run > 0) && (run < starts->Partitions())) { - if (styles->ValueAt(run-1) == styles->ValueAt(run)) { + const DISTANCE runBefore = run - 1; + if (styles->ValueAt(runBefore) == styles->ValueAt(run)) { RemoveRun(run); } } @@ -251,7 +252,8 @@ DISTANCE RunStyles<DISTANCE, STYLE>::Runs() const noexcept { template <typename DISTANCE, typename STYLE> bool RunStyles<DISTANCE, STYLE>::AllSame() const noexcept { for (DISTANCE run = 1; run < starts->Partitions(); run++) { - if (styles->ValueAt(run) != styles->ValueAt(run - 1)) + const DISTANCE runBefore = run - 1; + if (styles->ValueAt(run) != styles->ValueAt(runBefore)) return false; } return true; |