diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-01-18 21:34:56 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-01-18 21:34:56 +0000 |
commit | 7960ff184f15a3b6029fef8e5100d24a6c556afe (patch) | |
tree | e08cc7e45c67f31998f5976401de070227e921e2 | |
parent | 3902362acd1ce9432368b561fc00f7b691856ed2 (diff) | |
download | manaserv-7960ff184f15a3b6029fef8e5100d24a6c556afe.tar.gz manaserv-7960ff184f15a3b6029fef8e5100d24a6c556afe.tar.bz2 manaserv-7960ff184f15a3b6029fef8e5100d24a6c556afe.tar.xz manaserv-7960ff184f15a3b6029fef8e5100d24a6c556afe.zip |
Simplified isLoaded method, change also noted by Doener.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/mapmanager.cpp | 13 | ||||
-rw-r--r-- | src/mapmanager.h | 3 |
3 files changed, 6 insertions, 12 deletions
@@ -1,7 +1,7 @@ 2006-01-18 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/mapmanager.cpp, src/mapmanager.h: Some insignificant changes to - usage of the const keyword. + usage of the const keyword. Also simplified isLoaded method. 2006-01-18 Yohann Ferreira <bertram@cegetel.net> diff --git a/src/mapmanager.cpp b/src/mapmanager.cpp index 081ad508..73f8822e 100644 --- a/src/mapmanager.cpp +++ b/src/mapmanager.cpp @@ -92,17 +92,10 @@ Map *MapManager::getMap(const unsigned int mapId) return result; } -bool MapManager::isLoaded(const unsigned int mapId) const +bool +MapManager::isLoaded(const unsigned int mapId) const { - bool ret = false; - std::map<unsigned int, Map *>::const_iterator i; - - i = maps.find(mapId); - if (i != maps.end()) - { - ret = true; - } - return ret; + return maps.find(mapId) != maps.end(); } diff --git a/src/mapmanager.h b/src/mapmanager.h index 3347ae27..d516b4ce 100644 --- a/src/mapmanager.h +++ b/src/mapmanager.h @@ -66,7 +66,8 @@ class MapManager: public utils::Singleton<MapManager> /** * Check if a map was already loaded. */ - bool isLoaded(unsigned int mapId) const; + bool + isLoaded(unsigned int mapId) const; protected: /** |