Skip to content

Commit

Permalink
Fix size check
Browse files Browse the repository at this point in the history
Don't step an iterator past the end of the
container's range in the size check, as this
will cause a failure in debug mode.
  • Loading branch information
benmwebb committed Jun 17, 2023
1 parent b091f33 commit 2a1893d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/kernel/include/Index.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class CompressedIndexVector : public IndexVector<Tag, T> {
// starting at pos
for (runend = pos + 1; runend != P::end() && *runend == val; ++runend) {}
// exclude very short runs
if (runend > pos + 10) {
if (runend - pos > 10) {
if (pos > P::begin() && pos > start) {
// Write previous set of non-RLE values
write_no_compression(ar, start, pos);
Expand Down

0 comments on commit 2a1893d

Please sign in to comment.