reader: Use erase directly

No need to use a separate reference.

Also no need to erase from begin(), just use the indices.
This commit is contained in:
Fabian Homborg 2020-11-15 15:24:18 +01:00
parent 3eba6c5d5a
commit 263ef55ae6

View File

@ -1928,8 +1928,7 @@ bool reader_data_t::handle_completions(const completion_list_t &comp, size_t tok
if (use_prefix) {
for (completion_t &c : surviving_completions) {
c.flags &= ~COMPLETE_REPLACES_TOKEN;
wcstring &comp = c.completion;
comp.erase(comp.begin(), comp.begin() + common_prefix.size());
c.completion.erase(0, common_prefix.size());
}
}