diff options
author | Neil <nyamatongwe@gmail.com> | 2022-07-25 10:06:09 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-07-25 10:06:09 +1000 |
commit | f01ec460364301c3307d0fa68ce3e177c41626ce (patch) | |
tree | 3b75f9fdc01461054ee1c6394a46227a2a6e6133 | |
parent | baef3a7470fefa701f468ba5939f621d208c2b82 (diff) | |
download | scintilla-mirror-f01ec460364301c3307d0fa68ce3e177c41626ce.tar.gz |
Use T type parameter for RangeAddDelta arguments to harmonize types and avoid
warnings.
-rw-r--r-- | src/Partitioning.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Partitioning.h b/src/Partitioning.h index 0fffd119a..165672a15 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -28,21 +28,22 @@ public: void operator=(SplitVectorWithRangeAdd &&) = delete; ~SplitVectorWithRangeAdd() { } - void RangeAddDelta(ptrdiff_t start, ptrdiff_t end, T delta) noexcept { + void RangeAddDelta(T start, T end, T delta) noexcept { // end is 1 past end, so end-start is number of elements to change + ptrdiff_t position = start; ptrdiff_t i = 0; - const ptrdiff_t rangeLength = end - start; + const ptrdiff_t rangeLength = end - position; ptrdiff_t range1Length = rangeLength; - const ptrdiff_t part1Left = this->part1Length - start; + const ptrdiff_t part1Left = this->part1Length - position; if (range1Length > part1Left) range1Length = part1Left; while (i < range1Length) { - this->body[start++] += delta; + this->body[position++] += delta; i++; } - start += this->gapLength; + position += this->gapLength; while (i < rangeLength) { - this->body[start++] += delta; + this->body[position++] += delta; i++; } } |