From c7f106a09b9b54a6022fd9208ebd1a5899d76c8f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 17 Oct 2019 08:15:12 +1100 Subject: [PATCH] Slight code style change --- src/insert_completer.cc | 7 +++---- 1 file 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 matches; auto& word_db = get_word_db(buffer); - for (auto& m : word_db.find_matching(prefix)) - matches.push_back({ m, &buffer }); - + Vector matches = word_db.find_matching(prefix) + | transform([&](auto& m) { return RankedMatchAndBuffer{m, &buffer}; }) + | gather(); // Remove words that are being edited for (auto& word_count : sel_word_counts) {