1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-23 03:40:27 +00:00

Simplify loop in the addSkills()

This commit is contained in:
Andrei Kortunov 2019-02-17 11:53:02 +04:00
parent 80c62a4fe1
commit dc6ef15571

View file

@ -327,11 +327,9 @@ namespace MWGui
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString(titleId, titleDefault), coord1, coord2);
SkillList::const_iterator end = skills.end();
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
for (const int& skillId : skills)
{
int skillId = *it;
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
if (skillId < 0 || skillId >= ESM::Skill::Length) // Skip unknown skill indexes
continue;
assert(skillId >= 0 && skillId < ESM::Skill::Length);
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];