Avoid unneeded sort_and_merge_ovelapping call in select_all_matches

This commit is contained in:
Maxime Coste 2015-11-04 19:43:25 +00:00
parent 4c75c8d940
commit e82ca36117

View File

@ -590,7 +590,10 @@ void select_all_matches(SelectionList& selections, const Regex& regex)
}
if (result.empty())
throw runtime_error("nothing selected");
selections = std::move(result);
// Avoid SelectionList::operator=(Vector<Selection>) as we know result is
// already sorted and non overlapping.
selections = SelectionList{buffer, std::move(result)};
}
void split_selections(SelectionList& selections, const Regex& regex)