From 690d85d0e9ddeb1b881f5c259b92885f144f94cb Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 15 May 2021 15:38:17 +0200 Subject: [PATCH] Don't use at() instead [] when length is checked/known --- apps/openmw/mwrender/objectpaging.cpp | 2 +- apps/openmw/mwworld/cellstore.cpp | 4 ++-- apps/openmw/mwworld/store.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwrender/objectpaging.cpp b/apps/openmw/mwrender/objectpaging.cpp index 4217c4714..c6b568183 100644 --- a/apps/openmw/mwrender/objectpaging.cpp +++ b/apps/openmw/mwrender/objectpaging.cpp @@ -417,7 +417,7 @@ namespace MWRender { try { - unsigned int index = cell->mContextList.at(i).index; + unsigned int index = cell->mContextList[i].index; if (esm.size()<=index) esm.resize(index+1); cell->restore(esm[index], i); diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 73f69e220..efe575a1d 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -547,7 +547,7 @@ namespace MWWorld try { // Reopen the ESM reader and seek to the right position. - int index = mCell->mContextList.at(i).index; + int index = mCell->mContextList[i].index; mCell->restore (esm[index], i); ESM::CellRef ref; @@ -605,7 +605,7 @@ namespace MWWorld try { // Reopen the ESM reader and seek to the right position. - int index = mCell->mContextList.at(i).index; + int index = mCell->mContextList[i].index; mCell->restore (esm[index], i); ESM::CellRef ref; diff --git a/apps/openmw/mwworld/store.cpp b/apps/openmw/mwworld/store.cpp index 53ba3cfc2..e99b05a29 100644 --- a/apps/openmw/mwworld/store.cpp +++ b/apps/openmw/mwworld/store.cpp @@ -1003,7 +1003,7 @@ namespace MWWorld if (index >= mStatic.size()) { return nullptr; } - return &mStatic.at(index); + return &mStatic[index]; } const ESM::Attribute *Store::find(size_t index) const