diff options
| author | Johannes Altmanninger <aclopte@gmail.com> | 2022-08-17 00:11:26 +0200 |
|---|---|---|
| committer | Johannes Altmanninger <aclopte@gmail.com> | 2022-09-17 06:44:57 -0500 |
| commit | a33ec8dc809e7ffcb9db90f30c554d09883b0f48 (patch) | |
| tree | 3f31b119ba468b2917d829610f3d10da555ff9e6 /src/shared_string.cc | |
| parent | 674053935d3260dd54c4e0084c76e9170d731eb2 (diff) | |
Avoid potentially quadratic runtime when updating selections after modification
LineRangeSet::add_range() calls Vector::erase() in a loop over the
same vector. This could cause performance problems when there are many
selections. Fix this by only calling Vector::erase() once. I didn't
measure anything because my benchmark is dominated by another issue
(see next commit).
LineRangeSet::remove_range() also has a suspicious call to erase()
but that one is only used in test code, so it doesn't matter.
Diffstat (limited to 'src/shared_string.cc')
0 files changed, 0 insertions, 0 deletions
