diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-10-17 08:15:12 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-10-17 08:15:12 +1100 |
| commit | c7f106a09b9b54a6022fd9208ebd1a5899d76c8f (patch) | |
| tree | 2dbfb41abd26bdd511479db619c1858258166416 /src | |
| parent | 6dda47e26a0157281da640d4a48fb484c222bb80 (diff) | |
Slight code style change
Diffstat (limited to 'src')
| -rw-r--r-- | src/insert_completer.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 92adf361..e1cc5319 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -115,12 +115,11 @@ InsertCompletion complete_word(const SelectionList& sels, const Buffer* buffer; }; - Vector<RankedMatchAndBuffer> matches; auto& word_db = get_word_db(buffer); - for (auto& m : word_db.find_matching(prefix)) - matches.push_back({ m, &buffer }); - + Vector<RankedMatchAndBuffer> matches = word_db.find_matching(prefix) + | transform([&](auto& m) { return RankedMatchAndBuffer{m, &buffer}; }) + | gather<Vector>(); // Remove words that are being edited for (auto& word_count : sel_word_counts) { |
