[map] Simplify (de)construction of item_t

This commit is contained in:
Behdad Esfahbod 2022-11-17 16:10:37 -07:00
parent 99103bd976
commit 7f83040836
1 changed files with 2 additions and 4 deletions

View File

@ -90,16 +90,14 @@ struct hb_hashmap_t
void construct () void construct ()
{ {
new (std::addressof (key)) K (); new (this) item_t ();
new (std::addressof (value)) V ();
hash = 0; hash = 0;
is_used_ = false; is_used_ = false;
is_tombstone_ = false; is_tombstone_ = false;
} }
void reconstruct () void reconstruct ()
{ {
key.~K (); this->~item_t ();
value.~V ();
construct (); construct ();
} }