fix TMap move insertion, was using the copy constructor due to a missing std::move

This commit is contained in:
Ricardo Luís Vaz Silva 2023-04-01 01:04:43 -03:00 committed by Christoph Oelckers
parent b60b3fc09a
commit 65ea4f91b6

View file

@ -1128,12 +1128,12 @@ public:
Node *n = FindKey(key);
if (n != NULL)
{
n->Pair.Value = value;
n->Pair.Value = std::move(value);
}
else
{
n = NewKey(key);
::new(&n->Pair.Value) VT(value);
::new(&n->Pair.Value) VT(std::move(value));
}
return n->Pair.Value;
}