From 82777c0092889ee2d41501283ed1a4c16d802b55 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Tue, 16 Jun 2026 10:00:45 +0100 Subject: [PATCH] fix #9815 properly --- src/util/obj_hashtable.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/util/obj_hashtable.h b/src/util/obj_hashtable.h index 5020377e0..0b39163ea 100644 --- a/src/util/obj_hashtable.h +++ b/src/util/obj_hashtable.h @@ -62,10 +62,6 @@ public: struct key_data { Key * m_key = nullptr; Value m_value; - key_data() = default; - key_data(Key* k): m_key(k) {} - key_data(Key* k, Value const& v): m_key(k), m_value(v) {} - key_data(Key* k, Value&& v): m_key(k), m_value(std::move(v)) {} Value const & get_value() const { return m_value; } Key & get_key () const { return *m_key; } unsigned hash() const { return m_key->hash(); } @@ -136,15 +132,15 @@ public: } void insert(Key * const k, Value const & v) { - m_table.insert(key_data(k, v)); + m_table.insert(key_data{k, v}); } void insert(Key * const k, Value && v) { - m_table.insert(key_data(k, std::move(v))); + m_table.insert(key_data{k, std::move(v)}); } Value& insert_if_not_there(Key * k, Value const & v) { - return m_table.insert_if_not_there2(key_data(k, v))->get_data().m_value; + return m_table.insert_if_not_there2(key_data{k, v})->get_data().m_value; } Value& insert_if_not_there(Key * k, Value && v) { @@ -194,7 +190,7 @@ public: } iterator find_iterator(Key * k) const { - return m_table.find(key_data(k)); + return m_table.find(key_data{k}); } bool contains(Key * k) const { @@ -202,7 +198,7 @@ public: } void remove(Key * k) { - m_table.remove(key_data(k)); + m_table.remove(key_data{k}); } void erase(Key * k) { @@ -213,7 +209,7 @@ public: void get_collisions(Key * k, vector& collisions) { vector cs; - m_table.get_collisions(key_data(k), cs); + m_table.get_collisions(key_data{k}, cs); for (key_data const& kd : cs) { collisions.push_back(kd.m_key); }