[10594] Use equal_range instead of lower_bound/upper_bound pairs

(based on zergtmn's repo commit 0499169)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
zerg 2010-10-09 00:54:25 +04:00 committed by VladimirMangos
parent 0caa0e32dd
commit 2fa5fa43bd
13 changed files with 207 additions and 182 deletions

View file

@ -2443,9 +2443,8 @@ void SpellMgr::LoadSpellChains()
continue;
// some forward spells still exist but excluded from real use as ranks and not listed in skill abilities now
SkillLineAbilityMap::const_iterator forward_ab_low = mSkillLineAbilityMap.lower_bound(forward_id);
SkillLineAbilityMap::const_iterator forward_ab_up = mSkillLineAbilityMap.upper_bound(forward_id);
if (forward_ab_low == forward_ab_up)
SkillLineAbilityMapBounds bounds = mSkillLineAbilityMap.equal_range(forward_id);
if (bounds.first == bounds.second)
continue;
// spell already listed in chains store
@ -2639,11 +2638,11 @@ void SpellMgr::LoadSpellChains()
{
bool skip = false;
// some forward spells still exist but excluded from real use as ranks and not listed in skill abilities now
SkillLineAbilityMap::const_iterator forward_ab_low = mSkillLineAbilityMap.lower_bound(spell_id);
SkillLineAbilityMap::const_iterator forward_ab_up = mSkillLineAbilityMap.upper_bound(spell_id);
if (forward_ab_low == forward_ab_up)
SkillLineAbilityMapBounds bounds = mSkillLineAbilityMap.equal_range(spell_id);
if (bounds.first == bounds.second)
{
for(SkillLineAbilityMap::const_iterator ab_itr = mSkillLineAbilityMap.lower_bound(node.prev); ab_itr != mSkillLineAbilityMap.upper_bound(node.prev); ++ab_itr)
SkillLineAbilityMapBounds prev_bounds = mSkillLineAbilityMap.equal_range(node.prev);
for(SkillLineAbilityMap::const_iterator ab_itr = prev_bounds.first; ab_itr != prev_bounds.second; ++ab_itr)
{
// spell listed as forward and not listed as ability
// this is marker for removed ranks