mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[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:
parent
0caa0e32dd
commit
2fa5fa43bd
13 changed files with 207 additions and 182 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue