summaryrefslogtreecommitdiff
path: root/src/hook_manager.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2020-05-29 11:59:03 +1000
committerMaxime Coste <mawww@kakoune.org>2020-05-29 11:59:03 +1000
commit94f33bb63862357557ef533126a41d64b12f1c53 (patch)
tree4290036b7388a2b2a50972ec8ba0c9b25d9f9466 /src/hook_manager.cc
parent109abbeed40c776fdc33bd5c9344b6865122ef6d (diff)
Add a range based remove_if overload
Diffstat (limited to 'src/hook_manager.cc')
-rw-r--r--src/hook_manager.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/hook_manager.cc b/src/hook_manager.cc
index d27bf731..6e3ae178 100644
--- a/src/hook_manager.cc
+++ b/src/hook_manager.cc
@@ -36,14 +36,12 @@ void HookManager::remove_hooks(const Regex& regex)
{
for (auto& list : m_hooks)
{
- list.erase(std::remove_if(list.begin(), list.end(),
- [this, &regex](std::unique_ptr<HookData>& h) {
- if (not regex_match(h->group.begin(), h->group.end(), regex))
- return false;
- m_hooks_trash.push_back(std::move(h));
- return true;
- }),
- list.end());
+ list.erase(remove_if(list, [this, &regex](std::unique_ptr<HookData>& h) {
+ if (not regex_match(h->group.begin(), h->group.end(), regex))
+ return false;
+ m_hooks_trash.push_back(std::move(h));
+ return true;
+ }), list.end());
}
}