mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
AK: Allow specifying HashSetExistingEntryBehavior in HashMap::set()
This commit is contained in:
parent
8a80ff7b3b
commit
a453da2906
Notes:
github-actions[bot]
2025-05-03 15:35:05 +00:00
Author: https://github.com/awesomekling
Commit: a453da2906
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4573
1 changed files with 6 additions and 6 deletions
12
AK/HashMap.h
12
AK/HashMap.h
|
@ -57,12 +57,12 @@ public:
|
||||||
void clear() { m_table.clear(); }
|
void clear() { m_table.clear(); }
|
||||||
void clear_with_capacity() { m_table.clear_with_capacity(); }
|
void clear_with_capacity() { m_table.clear_with_capacity(); }
|
||||||
|
|
||||||
HashSetResult set(K const& key, V const& value) { return m_table.set({ key, value }); }
|
HashSetResult set(K const& key, V const& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.set({ key, value }, existing_entry_behavior); }
|
||||||
HashSetResult set(K const& key, V&& value) { return m_table.set({ key, move(value) }); }
|
HashSetResult set(K const& key, V&& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.set({ key, move(value) }, existing_entry_behavior); }
|
||||||
HashSetResult set(K&& key, V&& value) { return m_table.set({ move(key), move(value) }); }
|
HashSetResult set(K&& key, V&& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.set({ move(key), move(value) }, existing_entry_behavior); }
|
||||||
ErrorOr<HashSetResult> try_set(K const& key, V const& value) { return m_table.try_set({ key, value }); }
|
ErrorOr<HashSetResult> try_set(K const& key, V const& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.try_set({ key, value }, existing_entry_behavior); }
|
||||||
ErrorOr<HashSetResult> try_set(K const& key, V&& value) { return m_table.try_set({ key, move(value) }); }
|
ErrorOr<HashSetResult> try_set(K const& key, V&& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.try_set({ key, move(value) }, existing_entry_behavior); }
|
||||||
ErrorOr<HashSetResult> try_set(K&& key, V&& value) { return m_table.try_set({ move(key), move(value) }); }
|
ErrorOr<HashSetResult> try_set(K&& key, V&& value, HashSetExistingEntryBehavior existing_entry_behavior = HashSetExistingEntryBehavior::Replace) { return m_table.try_set({ move(key), move(value) }, existing_entry_behavior); }
|
||||||
|
|
||||||
bool remove(K const& key)
|
bool remove(K const& key)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue