Skip to content

Commit 4a78638

Browse files
committed
Revert "Do not use invalid iterators (#749)"
This reverts commit 8e2ea5d.
1 parent 8e2ea5d commit 4a78638

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/document.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,7 @@ struct Document {
507507
if (drawroot->grid && drawroot->grid->folded)
508508
SetSelect(drawroot->parent->grid->FindCell(drawroot));
509509
}
510-
if (auto diff = drawpath.size() - len)
511-
drawpath.erase(drawpath.begin(), drawpath.begin() + diff);
510+
while (len < drawpath.size()) drawpath.erase(drawpath.begin());
512511
}
513512

514513
void Zoom(int dir, wxDC &dc, bool fromroot = false) {

0 commit comments

Comments
 (0)