From 7960ff184f15a3b6029fef8e5100d24a6c556afe Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 18 Jan 2006 21:34:56 +0000 Subject: Simplified isLoaded method, change also noted by Doener. --- ChangeLog | 2 +- src/mapmanager.cpp | 13 +++---------- src/mapmanager.h | 3 ++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b4aef9b..3c5cfd16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2006-01-18 Bjørn Lindeijer * 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 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::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 /** * Check if a map was already loaded. */ - bool isLoaded(unsigned int mapId) const; + bool + isLoaded(unsigned int mapId) const; protected: /** -- cgit v1.2.3-60-g2f50