summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--src/mapmanager.cpp13
-rw-r--r--src/mapmanager.h3
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 <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:
/**