[10253] Small cleanup in Unit::HasAura() to prevent redundant upper_bound calls.

This commit is contained in:
Lynx3d 2010-07-23 23:12:08 +02:00
parent 61990de6dd
commit 6c6ce87867
3 changed files with 8 additions and 2 deletions

View file

@ -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;