mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-28 22:22:41 +03:00
compute_line_modifications: avoid potentially long iteration
This commit is contained in:
parent
fcce76ba57
commit
4cc9c9997e
@ -73,10 +73,13 @@ Vector<LineModification> compute_line_modifications(const Buffer& buffer, size_t
|
||||
}
|
||||
next = res.erase(next, delend);
|
||||
|
||||
for (auto it = next; it != res.end(); ++it)
|
||||
it->new_line -= diff;
|
||||
if (diff != 0)
|
||||
{
|
||||
for (auto it = next; it != res.end(); ++it)
|
||||
it->new_line -= diff;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (diff != 0)
|
||||
{
|
||||
for (auto it = next; it != res.end(); ++it)
|
||||
it->new_line += diff;
|
||||
|
Loading…
Reference in New Issue
Block a user