mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 19:20:26 +00:00
Merge branch 'const_ref_it' into 'master'
Use const references when possible in for loops See merge request OpenMW/openmw!869
This commit is contained in:
commit
6cb6461cba
@ -306,7 +306,7 @@ namespace MWGui
|
|||||||
deleteLater();
|
deleteLater();
|
||||||
for (Link* link : mLinks)
|
for (Link* link : mLinks)
|
||||||
delete link;
|
delete link;
|
||||||
for (auto link : mTopicLinks)
|
for (const auto& link : mTopicLinks)
|
||||||
delete link.second;
|
delete link.second;
|
||||||
for (auto history : mHistoryContents)
|
for (auto history : mHistoryContents)
|
||||||
delete history;
|
delete history;
|
||||||
|
@ -70,7 +70,7 @@ namespace MWMechanics
|
|||||||
auto& id = spell->mId;
|
auto& id = spell->mId;
|
||||||
bool changed = withBaseRecord([&] (auto& spells)
|
bool changed = withBaseRecord([&] (auto& spells)
|
||||||
{
|
{
|
||||||
for(auto it : spells)
|
for(const auto& it : spells)
|
||||||
{
|
{
|
||||||
if(Misc::StringUtils::ciEqual(id, it))
|
if(Misc::StringUtils::ciEqual(id, it))
|
||||||
return false;
|
return false;
|
||||||
|
@ -743,7 +743,7 @@ namespace MWRender
|
|||||||
ccf.mCell = cell;
|
ccf.mCell = cell;
|
||||||
mCache->call(ccf);
|
mCache->call(ccf);
|
||||||
if (ccf.mToClear.empty()) return false;
|
if (ccf.mToClear.empty()) return false;
|
||||||
for (auto chunk : ccf.mToClear)
|
for (const auto& chunk : ccf.mToClear)
|
||||||
mCache->removeFromObjectCache(chunk);
|
mCache->removeFromObjectCache(chunk);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -765,7 +765,7 @@ namespace MWRender
|
|||||||
ccf.mActiveGridOnly = true;
|
ccf.mActiveGridOnly = true;
|
||||||
mCache->call(ccf);
|
mCache->call(ccf);
|
||||||
if (ccf.mToClear.empty()) return false;
|
if (ccf.mToClear.empty()) return false;
|
||||||
for (auto chunk : ccf.mToClear)
|
for (const auto& chunk : ccf.mToClear)
|
||||||
mCache->removeFromObjectCache(chunk);
|
mCache->removeFromObjectCache(chunk);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace
|
|||||||
// We will replace invalid entries by fixed ones
|
// We will replace invalid entries by fixed ones
|
||||||
std::vector<ESM::NPC> npcsToReplace;
|
std::vector<ESM::NPC> npcsToReplace;
|
||||||
|
|
||||||
for (auto npcIter : npcs)
|
for (const auto& npcIter : npcs)
|
||||||
{
|
{
|
||||||
ESM::NPC npc = npcIter.second;
|
ESM::NPC npc = npcIter.second;
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user