mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +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)
|
void ModelSelection::add(const ModelIndex& index)
|
||||||
{
|
{
|
||||||
VERIFY(index.is_valid());
|
VERIFY(index.is_valid());
|
||||||
if (m_indices.contains(index))
|
if (m_indices.set(index) == AK::HashSetResult::InsertedNewEntry)
|
||||||
return;
|
notify_selection_changed();
|
||||||
m_indices.set(index);
|
|
||||||
notify_selection_changed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelSelection::add_all(const Vector<ModelIndex>& indices)
|
void ModelSelection::add_all(const Vector<ModelIndex>& indices)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue