From 2169e22e9304f39d7e9778f423a2c667e86c2b02 Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 5 May 2024 14:02:11 +0200 Subject: [PATCH] Move key when inserting item to mLODNameCache --- apps/openmw/mwrender/objectpaging.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index e44f4de96c..6799b2358b 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -664,13 +664,11 @@ namespace MWRender if (found != mLODNameCache.end() && found->first == key) model = found->second; else - model - = mLODNameCache - .insert(found, - { key, - Misc::ResourceHelpers::getLODMeshName(world.getESMVersions()[refNum.mContentFile], - model, mSceneManager->getVFS(), lod) }) - ->second; + model = mLODNameCache + .emplace_hint(found, std::move(key), + Misc::ResourceHelpers::getLODMeshName(world.getESMVersions()[refNum.mContentFile], + model, mSceneManager->getVFS(), lod)) + ->second; } osg::ref_ptr cnode = mSceneManager->getTemplate(model, false);