mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibGUI: Avoid double hash lookup in ModelSelection::add()
This commit is contained in:
parent
74311676cc
commit
a433727961
1 changed files with 2 additions and 4 deletions
|
@ -29,10 +29,8 @@ void ModelSelection::set(const ModelIndex& index)
|
|||
void ModelSelection::add(const ModelIndex& index)
|
||||
{
|
||||
VERIFY(index.is_valid());
|
||||
if (m_indices.contains(index))
|
||||
return;
|
||||
m_indices.set(index);
|
||||
notify_selection_changed();
|
||||
if (m_indices.set(index) == AK::HashSetResult::InsertedNewEntry)
|
||||
notify_selection_changed();
|
||||
}
|
||||
|
||||
void ModelSelection::add_all(const Vector<ModelIndex>& indices)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue