diff options
author | megamage <none@none> | 2009-02-21 17:03:39 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-21 17:03:39 -0600 |
commit | 4ecbdb128c59a20c9cfd5c59b4bc960b64e4dc19 (patch) | |
tree | adbbd3a36066dd68a860b9c6658b82744270f098 /src | |
parent | 3fb55c922f7b36d0746894702ada17203603fafb (diff) |
[7313] Optimized checks of presence in std::set Author: zhenya
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Channel.h | 7 | ||||
-rw-r--r-- | src/game/ChannelMgr.h | 2 | ||||
-rw-r--r-- | src/game/ObjectMgr.h | 12 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 2 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/game/Channel.h b/src/game/Channel.h index 0e12ff9362c..1e2ecafdc89 100644 --- a/src/game/Channel.h +++ b/src/game/Channel.h @@ -204,11 +204,8 @@ class Channel void SendToAllButOne(WorldPacket *data, uint64 who); void SendToOne(WorldPacket *data, uint64 who); - bool IsOn(uint64 who) const { return players.count(who) != 0; } - - bool IsBanned(const uint64 guid) const {return banned.count(guid) != 0; } - - bool IsFirst() const { return !(players.size() > 1); } + bool IsOn(uint64 who) const { return players.find(who) != players.end(); } + bool IsBanned(uint64 guid) const { return banned.find(guid) != banned.end(); } uint8 GetPlayerFlags(uint64 p) const { diff --git a/src/game/ChannelMgr.h b/src/game/ChannelMgr.h index 3a5469d8c63..66f692ef69c 100644 --- a/src/game/ChannelMgr.h +++ b/src/game/ChannelMgr.h @@ -40,7 +40,7 @@ class ChannelMgr } Channel *GetJoinChannel(const std::string& name, uint32 channel_id) { - if(channels.count(name) == 0) + if (channels.find(name) == channels.end()) { Channel *nchan = new Channel(name,channel_id); channels[name] = nchan; diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index ab17c281a9c..3946f912b96 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -432,8 +432,16 @@ class ObjectMgr return itr->second; return 0; } - bool IsTavernAreaTrigger(uint32 Trigger_ID) const { return mTavernAreaTriggerSet.count(Trigger_ID) != 0; } - bool IsGameObjectForQuests(uint32 entry) const { return mGameObjectForQuestSet.count(entry) != 0; } + bool IsTavernAreaTrigger(uint32 Trigger_ID) const + { + return mTavernAreaTriggerSet.find(Trigger_ID) != mTavernAreaTriggerSet.end(); + } + + bool IsGameObjectForQuests(uint32 entry) const + { + return mGameObjectForQuestSet.find(entry) != mGameObjectForQuestSet.end(); + } + bool IsGuildVaultGameObject(Player *player, uint64 guid) const { if(GameObject *go = ObjectAccessor::GetGameObject(*player, guid)) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index cb25bbfa522..7cd59aba455 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -987,7 +987,7 @@ class SpellMgr bool IsSpellLearnSpell(uint32 spell_id) const { - return mSpellLearnSpells.count(spell_id)!=0; + return mSpellLearnSpells.find(spell_id) != mSpellLearnSpells.end(); } SpellLearnSpellMap::const_iterator GetBeginSpellLearnSpell(uint32 spell_id) const diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 72a44568afc..2c87187e709 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7312" + #define REVISION_NR "7313" #endif // __REVISION_NR_H__ |