Skip to content

Commit 9b63b17

Browse files
avoid look past std::vector, as identified by cran valgrind (#5426)
* avoid look past std::vector, as identified by cran valgrind Co-authored-by: Lionel Henry <[email protected]>
1 parent e629e04 commit 9b63b17

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/group_by.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ class VectorExpander : public Expander {
178178
for (R_xlen_t j = start; j < end;) {
179179
R_xlen_t current = vec_pos[j];
180180
R_xlen_t start_idx = j;
181-
while (j < end && vec_pos[++j] == current);
181+
182+
++j;
183+
for (; j < end && vec_pos[j] == current; ++j);
182184
expanders.push_back(expander(data_, positions_, depth_ + 1, current, start_idx, j));
183185
}
184186
}

0 commit comments

Comments
 (0)