diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-08-22 20:19:27 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-08-22 20:37:14 +0100 |
| commit | ac81d0f39cb1139472b2d2e90156f10324257777 (patch) | |
| tree | 176a33526b31616819d157eef4736f85a864ef6d /src/input_handler.cc | |
| parent | 56a7c6e594d9ff0d048d3bdf5513d5322bba0fb3 (diff) | |
Cleanup history_push function
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index 5e246b5a..d6850a51 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -881,12 +881,10 @@ private: static void history_push(History& history, StringView entry) { if(entry.empty() or is_horizontal_blank(entry[0_byte])) - { return; - } - History::iterator it; - while ((it = find(history, entry)) != history.end()) - history.erase(it); + + history.erase(std::remove(history.begin(), history.end(), entry), + history.end()); history.push_back(entry.str()); } }; |
