From eb829924da68a191687f80671b543c6da399b151 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Mar 2022 19:14:29 +0100 Subject: [PATCH] AK: Remove return value from HashTable::remove() and HashMap::remove() This was only used by remove_all_matching(), where it's no longer used. --- AK/HashMap.h | 4 ++-- AK/HashTable.h | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/AK/HashMap.h b/AK/HashMap.h index 3ba4f424bf..87d66c2523 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -189,9 +189,9 @@ public: return find(value) != end(); } - IteratorType remove(IteratorType it) + void remove(IteratorType it) { - return m_table.remove(it); + m_table.remove(it); } V& ensure(const K& key) diff --git a/AK/HashTable.h b/AK/HashTable.h index 784c851a91..3cc0691c30 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -389,7 +389,7 @@ public: return false; } - Iterator remove(Iterator iterator) + void remove(Iterator iterator) { VERIFY(iterator.m_bucket); auto& bucket = *iterator.m_bucket; @@ -399,14 +399,9 @@ public: if constexpr (!IsOrdered) VERIFY(!bucket.end); - auto next_iterator = iterator; - ++next_iterator; - delete_bucket(bucket); --m_size; ++m_deleted_count; - - return next_iterator; } template