diff options
author | Spp <spp@jorge.gr> | 2013-01-02 09:53:43 +0100 |
---|---|---|
committer | Spp <spp@jorge.gr> | 2013-01-02 09:53:43 +0100 |
commit | d36c4a91ba76680e64b108db3d866d208f4f86cc (patch) | |
tree | 0bcf3784e9c5128f0298722ecd47fc3df5744296 /src/server/game/Instances/InstanceSaveMgr.cpp | |
parent | 2292025bf9ccd78c004027f2e0621473ced82b22 (diff) |
Core/Misc: Use equal_range instead of lower_bound/upper_bound calls where possible.
Diffstat (limited to 'src/server/game/Instances/InstanceSaveMgr.cpp')
-rw-r--r-- | src/server/game/Instances/InstanceSaveMgr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ca09a570beb..81b148d8eaf 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -295,6 +295,7 @@ void InstanceSaveManager::LoadResetTimes() // index instance ids by map/difficulty pairs for fast reset warning send typedef std::multimap<uint32 /*PAIR32(map, difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; + typedef std::pair<ResetTimeMapDiffInstances::const_iterator, ResetTimeMapDiffInstances::const_iterator> ResetTimeMapDiffInstancesBounds; ResetTimeMapDiffInstances mapDiffResetInstances; QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"); @@ -378,8 +379,6 @@ void InstanceSaveManager::LoadResetTimes() } while (result->NextRow()); } - ResetTimeMapDiffInstances::const_iterator in_itr; - // calculate new global reset times for expired instances and those that have never been reset yet // add the global reset times to the priority queue for (MapDifficultyMap::const_iterator itr = sMapDifficultyMap.begin(); itr != sMapDifficultyMap.end(); ++itr) @@ -423,8 +422,9 @@ void InstanceSaveManager::LoadResetTimes() ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, 0)); - for (in_itr = mapDiffResetInstances.lower_bound(map_diff_pair); in_itr != mapDiffResetInstances.upper_bound(map_diff_pair); ++in_itr) - ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, in_itr->second)); + ResetTimeMapDiffInstancesBounds range = mapDiffResetInstances.equal_range(map_diff_pair); + for (; range.first != range.second; ++range.first) + ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, range.first->second)); } } |