Slight code style change

This commit is contained in:
Maxime Coste 2019-10-17 08:15:12 +11:00
parent 6dda47e26a
commit c7f106a09b

View File

@ -115,12 +115,11 @@ InsertCompletion complete_word(const SelectionList& sels,
const Buffer* buffer; const Buffer* buffer;
}; };
Vector<RankedMatchAndBuffer> matches;
auto& word_db = get_word_db(buffer); auto& word_db = get_word_db(buffer);
for (auto& m : word_db.find_matching(prefix)) Vector<RankedMatchAndBuffer> matches = word_db.find_matching(prefix)
matches.push_back({ m, &buffer }); | transform([&](auto& m) { return RankedMatchAndBuffer{m, &buffer}; })
| gather<Vector>();
// Remove words that are being edited // Remove words that are being edited
for (auto& word_count : sel_word_counts) for (auto& word_count : sel_word_counts)
{ {