forked from mia/Aegisub
Make BaseGrid::UpdateMaps far less slow
This commit is contained in:
parent
9a347b0b29
commit
2a316e5a55
1 changed files with 3 additions and 3 deletions
|
@ -301,12 +301,12 @@ void BaseGrid::UpdateMaps(bool preserve_selected_rows) {
|
||||||
SetSelectedSet(sel);
|
SetSelectedSet(sel);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Selection lines;
|
auto sorted = index_line_map;
|
||||||
copy(index_line_map.begin(), index_line_map.end(), inserter(lines, lines.begin()));
|
sort(begin(sorted), end(sorted));
|
||||||
Selection new_sel;
|
Selection new_sel;
|
||||||
// Remove lines which no longer exist from the selection
|
// Remove lines which no longer exist from the selection
|
||||||
set_intersection(selection.begin(), selection.end(),
|
set_intersection(selection.begin(), selection.end(),
|
||||||
lines.begin(), lines.end(),
|
sorted.begin(), sorted.end(),
|
||||||
inserter(new_sel, new_sel.begin()));
|
inserter(new_sel, new_sel.begin()));
|
||||||
|
|
||||||
SetSelectedSet(new_sel);
|
SetSelectedSet(new_sel);
|
||||||
|
|
Loading…
Reference in a new issue