diff options
| author | Zufu Liu <unknown> | 2022-07-04 09:58:26 +1000 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2022-07-04 09:58:26 +1000 |
| commit | e85eee7838814ad178a841527199270e936efd72 (patch) | |
| tree | 3bf5968349af41859448eb73fc562ec25574713e /src/Partitioning.h | |
| parent | 4c7b9d551b0304c4184fda8cb803c95a64742fbf (diff) | |
| download | scintilla-mirror-e85eee7838814ad178a841527199270e936efd72.tar.gz | |
Feature [feature-requests:#1442] Tighter checking of indices avoids handling
out-of-bounds in lower layer. Make expressions agree in ApplyStep for clarity.
Diffstat (limited to 'src/Partitioning.h')
| -rw-r--r-- | src/Partitioning.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Partitioning.h b/src/Partitioning.h index efa6bf95e..0fffd119a 100644 --- a/src/Partitioning.h +++ b/src/Partitioning.h @@ -70,7 +70,7 @@ private: body->RangeAddDelta(stepPartition+1, partitionUpTo + 1, stepLength); } stepPartition = partitionUpTo; - if (stepPartition >= body->Length()-1) { + if (stepPartition >= Partitions()) { stepPartition = Partitions(); stepLength = 0; } @@ -149,7 +149,7 @@ public: void SetPartitionStartPosition(T partition, T pos) noexcept { ApplyStep(partition+1); - if ((partition < 0) || (partition > body->Length())) { + if ((partition < 0) || (partition >= body->Length())) { return; } body->SetValueAt(partition, pos); |
