mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[10253] Small cleanup in Unit::HasAura() to prevent redundant upper_bound calls.
This commit is contained in:
parent
61990de6dd
commit
6c6ce87867
3 changed files with 8 additions and 2 deletions
|
|
@ -4755,7 +4755,8 @@ Aura* Unit::GetAura(AuraType type, uint32 family, uint64 familyFlag, uint32 fami
|
|||
|
||||
bool Unit::HasAura(uint32 spellId, SpellEffectIndex effIndex) const
|
||||
{
|
||||
for(SpellAuraHolderMap::const_iterator i_holder = m_spellAuraHolders.lower_bound(spellId); i_holder != m_spellAuraHolders.upper_bound(spellId); ++i_holder)
|
||||
SpellAuraHolderConstBounds spair = GetSpellAuraHolderBounds(spellId);
|
||||
for(SpellAuraHolderMap::const_iterator i_holder = spair.first; i_holder != spair.second; ++i_holder)
|
||||
if (i_holder->second->GetAuraByEffectIndex(effIndex))
|
||||
return true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue