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);
|
next = res.erase(next, delend);
|
||||||
|
|
||||||
for (auto it = next; it != res.end(); ++it)
|
if (diff != 0)
|
||||||
it->new_line -= diff;
|
{
|
||||||
|
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)
|
for (auto it = next; it != res.end(); ++it)
|
||||||
it->new_line += diff;
|
it->new_line += diff;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user