Cleanup history_push function
This commit is contained in:
parent
56a7c6e594
commit
ac81d0f39c
|
@ -881,12 +881,10 @@ private:
|
||||||
static void history_push(History& history, StringView entry)
|
static void history_push(History& history, StringView entry)
|
||||||
{
|
{
|
||||||
if(entry.empty() or is_horizontal_blank(entry[0_byte]))
|
if(entry.empty() or is_horizontal_blank(entry[0_byte]))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
History::iterator it;
|
history.erase(std::remove(history.begin(), history.end(), entry),
|
||||||
while ((it = find(history, entry)) != history.end())
|
history.end());
|
||||||
history.erase(it);
|
|
||||||
history.push_back(entry.str());
|
history.push_back(entry.str());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user