diff options
-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: /** |