From bce577e663e28e1942fda371235eba091a6ea8e2 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 2 Mar 2012 20:43:10 +0100 Subject: Removed some 'const' keywords from value returns It makes no sense to mark a return value as const when it is returned by value. This only makes sense if the return value is passed by reference, in order to prevent the receiver from modifying the value. Also made some other small adjustments. A std::string does not need to be initialized to "" explicitly and getSafeUtf8String could take its parameter by reference. Reviewed-by: Yohann Ferreira --- src/map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 8c748bbc..fa3d9a4c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -644,12 +644,12 @@ void Map::removeActor(Actors::iterator iterator) mActors.erase(iterator); } -const std::string Map::getMusicFile() const +std::string Map::getMusicFile() const { return getProperty("music"); } -const std::string Map::getName() const +std::string Map::getName() const { if (hasProperty("name")) return getProperty("name"); @@ -657,7 +657,7 @@ const std::string Map::getName() const return getProperty("mapname"); } -const std::string Map::getFilename() const +std::string Map::getFilename() const { std::string fileName = getProperty("_filename"); int lastSlash = fileName.rfind("/") + 1; -- cgit v1.2.3-70-g09d2