From a3cd3281fb76214b629f95fc4eb75c3a21329042 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Sun, 26 Apr 2020 16:17:06 +0300 Subject: [PATCH] Use an array instead of a map in spellSchoolToSkill() --- apps/openmw/mwmechanics/spellcasting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index d7645a698..ed8972f05 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -32,12 +32,12 @@ namespace MWMechanics { ESM::Skill::SkillEnum spellSchoolToSkill(int school) { - static const std::map schoolSkillMap + static const std::array schoolSkillArray { - {0, ESM::Skill::Alteration}, {1, ESM::Skill::Conjuration}, {2, ESM::Skill::Destruction}, - {3, ESM::Skill::Illusion}, {4, ESM::Skill::Mysticism}, {5, ESM::Skill::Restoration} + ESM::Skill::Alteration, ESM::Skill::Conjuration, ESM::Skill::Destruction, + ESM::Skill::Illusion, ESM::Skill::Mysticism, ESM::Skill::Restoration }; - return schoolSkillMap.at(school); + return schoolSkillArray.at(school); } float calcEffectCost(const ESM::ENAMstruct& effect, const ESM::MagicEffect* magicEffect)