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

pull/692/head
phkahler 2020-08-27 16:39:03 -04:00
parent 6894b0c9c3
commit d3da2c8b22
1 changed files with 5 additions and 1 deletions

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;
}