Cleanup history_push function

This commit is contained in:
Maxime Coste 2016-08-22 20:19:27 +01:00
parent 56a7c6e594
commit ac81d0f39c

View File

@ -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());
}
};