chore(Apps/Codestyle): add new codestyle checks for pointers and range loops (#19841)

* chore(Apps/Codestyle): add new codestyle checks for pointers and range loops

* revert a typo
This commit is contained in:
Grimdhex
2024-09-03 18:02:38 +02:00
committed by GitHub
parent c929b95172
commit 221dbd3fdb
18 changed files with 52 additions and 29 deletions

View File

@@ -7739,7 +7739,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
// remove FD and invisibility at all loots
constexpr std::array<AuraType, 2> toRemove = {SPELL_AURA_MOD_INVISIBILITY, SPELL_AURA_FEIGN_DEATH};
for (const auto& aura : toRemove)
for (auto const& aura : toRemove)
{
RemoveAurasByType(aura);
}

View File

@@ -29,7 +29,7 @@ PlayerSocial::PlayerSocial(): m_playerGUID() { }
uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) const
{
uint32 counter = 0;
for (const auto& itr : m_playerSocialMap)
for (auto const& itr : m_playerSocialMap)
{
if ((itr.second.Flags & flag) != 0)
++counter;
@@ -178,7 +178,7 @@ void PlayerSocial::SendSocialList(Player* player, uint32 flags)
bool PlayerSocial::_checkContact(ObjectGuid guid, SocialFlag flags) const
{
const auto& itr = m_playerSocialMap.find(guid);
auto const& itr = m_playerSocialMap.find(guid);
if (itr != m_playerSocialMap.end())
return (itr->second.Flags & flags) != 0;

View File

@@ -2657,7 +2657,7 @@ bool Unit::GetMeleeAttackPoint(Unit* attacker, Position& pos)
double attackerSize = attacker->GetCollisionRadius();
for (const auto& otherAttacker: attackers)
for (auto const& otherAttacker: attackers)
{
// if the otherAttacker is not valid, skip
if (!otherAttacker || otherAttacker->GetGUID() == attacker->GetGUID() ||