summaryrefslogtreecommitdiff
path: root/src/insert_completer.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-01-08 22:30:15 +0000
committerMaxime Coste <mawww@kakoune.org>2017-01-08 22:39:01 +0000
commitdcd8f6ef0105578e10dc18975871bc59154e008c (patch)
tree2e0e2e11d4afcf9c351c3a7dd8c9847b253d3017 /src/insert_completer.cc
parent9dfd17a5bc584a66711707044bdf27ff57e7aebb (diff)
Apply clang-tidy modernize to the codebase
Diffstat (limited to 'src/insert_completer.cc')
-rw-r--r--src/insert_completer.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc
index 43d512a6..239da7cc 100644
--- a/src/insert_completer.cc
+++ b/src/insert_completer.cc
@@ -14,6 +14,7 @@
#include "user_interface.hh"
#include <numeric>
+#include <utility>
namespace Kakoune
{
@@ -113,8 +114,8 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o
struct RankedMatchAndBuffer : RankedMatch
{
- RankedMatchAndBuffer(const RankedMatch& m, const Buffer* b)
- : RankedMatch{m}, buffer{b} {}
+ RankedMatchAndBuffer(RankedMatch m, const Buffer* b)
+ : RankedMatch{std::move(m)}, buffer{b} {}
using RankedMatch::operator==;
using RankedMatch::operator<;
@@ -400,11 +401,11 @@ void InsertCompleter::select(int offset, Vector<Key>& keystrokes)
}
for (auto i = 0_byte; i < prefix_len; ++i)
- keystrokes.push_back(Key::Backspace);
+ keystrokes.emplace_back(Key::Backspace);
for (auto i = 0_byte; i < suffix_len; ++i)
- keystrokes.push_back(Key::Delete);
+ keystrokes.emplace_back(Key::Delete);
for (auto& c : candidate.completion)
- keystrokes.push_back(c);
+ keystrokes.emplace_back(c);
}
void InsertCompleter::update()