From d3da2c8b22d8f84e84adcce329e3b97a6a063e10 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Thu, 27 Aug 2020 16:39:03 -0400 Subject: [PATCH] Performance: Don't call std::inplace_merge for IdList::AddAndAssignID() via Add() because it is redundant. --- src/dsc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dsc.h b/src/dsc.h index 5a431a7..f07d932 100644 --- a/src/dsc.h +++ b/src/dsc.h @@ -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; }