[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 ()
{
new (std::addressof (key)) K ();
new (std::addressof (value)) V ();
new (this) item_t ();
hash = 0;
is_used_ = false;
is_tombstone_ = false;
}
void reconstruct ()
{
key.~K ();
value.~V ();
this->~item_t ();
construct ();
}