[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

@ -1290,10 +1290,10 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
bool Creature::hasQuest(uint32 quest_id) const
{
QuestRelations const& qr = sObjectMgr.mCreatureQuestRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(GetEntry());
for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
if(itr->second==quest_id)
if (itr->second == quest_id)
return true;
}
return false;
@ -1301,10 +1301,10 @@ bool Creature::hasQuest(uint32 quest_id) const
bool Creature::hasInvolvedQuest(uint32 quest_id) const
{
QuestRelations const& qr = sObjectMgr.mCreatureQuestInvolvedRelations;
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestInvolvedRelationsMapBounds(GetEntry());
for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
if(itr->second == quest_id)
if (itr->second == quest_id)
return true;
}
return false;