summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorVitaly Dyachkov <obyknovenius@me.com>2022-04-12 19:21:05 +0200
committerLinus Groh <mail@linusgroh.de>2022-05-08 17:02:00 +0200
commita0a4d169f47e03802b885bf16c997281313ec8e1 (patch)
tree659a76d6a2e34fdab8207fb044b4ad3eef1b0773 /Userland
parent6ed2ded77c2c56b26d3b33a037b5fd2deee74148 (diff)
downloadserenity-a0a4d169f47e03802b885bf16c997281313ec8e1.zip
AK+LibGUI: Pass predicate to *_matching() methods by const reference
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/ModelSelection.cpp4
-rw-r--r--Userland/Libraries/LibGUI/ModelSelection.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/ModelSelection.cpp b/Userland/Libraries/LibGUI/ModelSelection.cpp
index 8e11c3f423..6fac46b8f1 100644
--- a/Userland/Libraries/LibGUI/ModelSelection.cpp
+++ b/Userland/Libraries/LibGUI/ModelSelection.cpp
@@ -10,9 +10,9 @@
namespace GUI {
-void ModelSelection::remove_all_matching(Function<bool(ModelIndex const&)> filter)
+void ModelSelection::remove_all_matching(Function<bool(ModelIndex const&)> const& filter)
{
- if (m_indices.remove_all_matching([&](ModelIndex const& index) { return filter(index); }))
+ if (m_indices.remove_all_matching(filter))
notify_selection_changed();
}
diff --git a/Userland/Libraries/LibGUI/ModelSelection.h b/Userland/Libraries/LibGUI/ModelSelection.h
index b89d632012..79592159aa 100644
--- a/Userland/Libraries/LibGUI/ModelSelection.h
+++ b/Userland/Libraries/LibGUI/ModelSelection.h
@@ -76,7 +76,7 @@ public:
return *m_indices.begin();
}
- void remove_all_matching(Function<bool(ModelIndex const&)> filter);
+ void remove_all_matching(Function<bool(ModelIndex const&)> const& filter);
template<typename Function>
void change_from_model(Badge<SortingProxyModel>, Function f)