refactor(Core): apply clang-tidy modernize-loop-convert (#3822)

This commit is contained in:
Francesco Borzì
2020-12-07 19:04:19 +01:00
committed by GitHub
parent 0b7b36f20c
commit 0b8ec1f6ee
16 changed files with 125 additions and 130 deletions

View File

@@ -511,7 +511,7 @@ typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator
struct PetLevelInfo
{
PetLevelInfo() : health(0), mana(0), armor(0), min_dmg(0), max_dmg(0) { for (uint8 i = 0; i < MAX_STATS; ++i) stats[i] = 0; }
PetLevelInfo() : health(0), mana(0), armor(0), min_dmg(0), max_dmg(0) { for (unsigned short & stat : stats) stat = 0; }
uint16 stats[MAX_STATS];
uint16 health;
@@ -1076,9 +1076,9 @@ public:
if (map_itr == _mailLevelRewardStore.end())
return nullptr;
for (MailLevelRewardList::const_iterator set_itr = map_itr->second.begin(); set_itr != map_itr->second.end(); ++set_itr)
if (set_itr->raceMask & raceMask)
return &*set_itr;
for (const auto & set_itr : map_itr->second)
if (set_itr.raceMask & raceMask)
return &set_itr;
return nullptr;
}