mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibGUI: Use HashTable::remove_all_matching() in GUI::ModelSelection
This commit is contained in:
parent
558fb0a04a
commit
c6bcd0dfe4
1 changed files with 1 additions and 9 deletions
|
@ -12,16 +12,8 @@ namespace GUI {
|
|||
|
||||
void ModelSelection::remove_matching(Function<bool(const ModelIndex&)> filter)
|
||||
{
|
||||
Vector<ModelIndex> to_remove;
|
||||
for (auto& index : m_indices) {
|
||||
if (filter(index))
|
||||
to_remove.append(index);
|
||||
}
|
||||
if (!to_remove.is_empty()) {
|
||||
for (auto& index : to_remove)
|
||||
m_indices.remove(index);
|
||||
if (m_indices.remove_all_matching([&](ModelIndex const& index) { return filter(index); }))
|
||||
notify_selection_changed();
|
||||
}
|
||||
}
|
||||
|
||||
void ModelSelection::set(const ModelIndex& index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue