1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-30 15:36:45 +00:00

Avoid making string copies instead of references

This commit is contained in:
Capostrophic 2018-11-08 17:03:29 +03:00
parent 4cb4f82431
commit 6d48d9329e

View file

@ -129,7 +129,7 @@ namespace MWMechanics
npcStats.getSkill (i).setBase (5 + bonus);
}
for (const std::string power : race->mPowers.mList)
for (const std::string &power : race->mPowers.mList)
{
creatureStats.getSpells().add(power);
}
@ -144,7 +144,7 @@ namespace MWMechanics
const ESM::BirthSign *sign =
esmStore.get<ESM::BirthSign>().find(signId);
for (const std::string power : sign->mPowers.mList)
for (const std::string &power : sign->mPowers.mList)
{
creatureStats.getSpells().add(power);
}
@ -216,7 +216,7 @@ namespace MWMechanics
std::vector<std::string> selectedSpells = autoCalcPlayerSpells(skills, attributes, race);
for (const std::string spell : selectedSpells)
for (const std::string &spell : selectedSpells)
creatureStats.getSpells().add(spell);
// forced update and current value adjustments