From b73017bccb8d7acdfd67e7df0565c3d2417569e5 Mon Sep 17 00:00:00 2001 From: false_genesis Date: Mon, 11 Feb 2008 18:49:42 +0000 Subject: [PATCH] * one more little speedup in objmgr --- src/Client/World/ObjMgr.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Client/World/ObjMgr.cpp b/src/Client/World/ObjMgr.cpp index 8c61e5b..3d367d6 100644 --- a/src/Client/World/ObjMgr.cpp +++ b/src/Client/World/ObjMgr.cpp @@ -94,8 +94,9 @@ void ObjMgr::Add(ItemProto *proto) ItemProto *ObjMgr::GetItemProto(uint32 entry) { - if(_iproto.find(entry) != _iproto.end()) - return _iproto[entry]; + ItemProtoMap::iterator it = _iproto.find(entry); + if(it != _iproto.end()) + return it->second; return NULL; } @@ -118,8 +119,9 @@ void ObjMgr::Add(CreatureTemplate *cr) CreatureTemplate *ObjMgr::GetCreatureTemplate(uint32 entry) { - if(_creature_templ.find(entry) != _creature_templ.end()) - return _creature_templ[entry]; + CreatureTemplateMap::iterator it = _creature_templ.find(entry); + if(it != _creature_templ.end()) + return it->second; return NULL; }