diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-02 20:43:10 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-18 19:58:55 +0100 |
commit | bce577e663e28e1942fda371235eba091a6ea8e2 (patch) | |
tree | a54ce0b47eae92b760ddd763036ff3609d1415ef /src/map.cpp | |
parent | 20afba1adc84dd0e859605250c5a44a111045c2b (diff) | |
download | mana-bce577e663e28e1942fda371235eba091a6ea8e2.tar.gz mana-bce577e663e28e1942fda371235eba091a6ea8e2.tar.bz2 mana-bce577e663e28e1942fda371235eba091a6ea8e2.tar.xz mana-bce577e663e28e1942fda371235eba091a6ea8e2.zip |
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
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; |