From 17222eb8219b546db7ec948e6a16616d2cb5ac76 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Sun, 6 May 2018 16:42:05 +0400 Subject: [PATCH] Get rid of unnecessary find --- apps/openmw/mwworld/store.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index e9968c38f1..6f0a1b49f8 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -1070,12 +1070,10 @@ namespace MWWorld if (search(marker.first) == 0) { ESM::Static newMarker = ESM::Static(marker.first, marker.second); - mStatic.insert(std::make_pair(marker.first, newMarker)); - - std::map::iterator found = mStatic.find(marker.first); - if (found != mStatic.end()) + std::pair ret = mStatic.insert(std::make_pair(marker.first, newMarker)); + if (ret.first != mStatic.end()) { - mShared.push_back(&found->second); + mShared.push_back(&ret.first->second); } } }