From b957c08f02786ffc004cd8077addfe44682624eb Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 9 Jan 2026 10:37:55 -0500 Subject: Optimize gObjectList findObject and getUUIDFromLocal with unordered_map due to frequent find access --- indra/newview/llviewerobjectlist.cpp | 2 +- indra/newview/llviewerobjectlist.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 50edb408c7..34e5cc9de8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -174,7 +174,7 @@ bool LLViewerObjectList::removeFromLocalIDTable(LLViewerObject* objectp) U32 local_id = objectp->mLocalID; U64 indexid = (((U64)objectp->mRegionIndex) << 32) | (U64)local_id; - std::map::iterator iter = mIndexAndLocalIDToUUID.find(indexid); + auto iter = mIndexAndLocalIDToUUID.find(indexid); if (iter == mIndexAndLocalIDToUUID.end()) { return false; diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 547ef9fb2d..adc90a0483 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -204,7 +204,7 @@ protected: uuid_set_t mDeadObjects; - std::map > mUUIDObjectMap; + std::unordered_map > mUUIDObjectMap; //set of objects that need to update their cost uuid_set_t mStaleObjectCost; @@ -221,7 +221,7 @@ protected: static U32 sSimulatorMachineIndex; std::map mIPAndPortToIndex; - std::map mIndexAndLocalIDToUUID; + std::unordered_map mIndexAndLocalIDToUUID; friend class LLViewerObject; -- cgit v1.3