1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:47:45 +00:00

AK+LibGUI: Pass predicate to *_matching() methods by const reference

This commit is contained in:
Vitaly Dyachkov 2022-04-12 19:21:05 +02:00 committed by Linus Groh
parent 6ed2ded77c
commit a0a4d169f4
5 changed files with 12 additions and 12 deletions

View file

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

View file

@ -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)