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);