From e77ee5c20fdd9d7e7966e588d58a02339aaa3c6c Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 27 Jul 2025 18:40:39 +0200 Subject: [PATCH] Do not copy cell store to count refs --- apps/openmw/mwworld/esmstore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index ea183b6b53..7262805f81 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -566,10 +566,10 @@ namespace MWWorld std::vector refs; std::set keyIDs; std::vector refIDs; - Store Cells = get(); - for (auto it = Cells.intBegin(); it != Cells.intEnd(); ++it) + const Store& cells = get(); + for (auto it = cells.intBegin(); it != cells.intEnd(); ++it) readRefs(*it, refs, refIDs, keyIDs, readers); - for (auto it = Cells.extBegin(); it != Cells.extEnd(); ++it) + for (auto it = cells.extBegin(); it != cells.extEnd(); ++it) readRefs(*it, refs, refIDs, keyIDs, readers); const auto lessByRefNum = [](const Ref& l, const Ref& r) { return l.mRefNum < r.mRefNum; }; std::stable_sort(refs.begin(), refs.end(), lessByRefNum);