Performance: Don't call std::inplace_merge for IdList::AddAndAssignID() via Add() because it is redundant.

This commit is contained in:
phkahler 2020-08-27 16:39:03 -04:00
parent 6894b0c9c3
commit d3da2c8b22

View File

@ -368,7 +368,11 @@ public:
H AddAndAssignId(T *t) {
t->h.v = (MaximumId() + 1);
Add(t);
AllocForOneMore();
// Copy-construct at the end of the list.
new(&elem[n]) T(*t);
++n;
return t->h;
}