From d3ed94885bcce5b7216ee23dc729de5409b73e53 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Thu, 17 Aug 2023 21:57:54 +0200 Subject: SL-20140 Optimization LLDictionary::addEntry() - avoid of double search --- indra/llcommon/lldictionary.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llcommon/lldictionary.h') diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 5800ec5e5d..3e86767d7e 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -87,11 +87,10 @@ protected: } void addEntry(Index index, Entry *entry) { - if (lookup(index)) + if (!insert(value_type(index, entry)).second) { LL_ERRS() << "Dictionary entry already added (attempted to add duplicate entry)" << LL_ENDL; } - (*this)[index] = entry; } }; -- cgit v1.2.3 From 488b51b863c7902ed9f58179f664a1779ad148fb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 1 Sep 2023 00:04:20 +0300 Subject: MacOS build fix --- indra/llcommon/lldictionary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/lldictionary.h') diff --git a/indra/llcommon/lldictionary.h b/indra/llcommon/lldictionary.h index 3e86767d7e..18664e340e 100644 --- a/indra/llcommon/lldictionary.h +++ b/indra/llcommon/lldictionary.h @@ -87,7 +87,7 @@ protected: } void addEntry(Index index, Entry *entry) { - if (!insert(value_type(index, entry)).second) + if (!this->emplace(index, entry).second) { LL_ERRS() << "Dictionary entry already added (attempted to add duplicate entry)" << LL_ENDL; } -- cgit v1.2.3