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/resources/beinginfo.cpp | 2 +- src/resources/iteminfo.cpp | 2 +- src/resources/userpalette.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/resources') diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 8683e7bc..5a277770 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -84,7 +84,7 @@ void BeingInfo::addSound(SoundEvent event, const std::string &filename) const std::string &BeingInfo::getSound(SoundEvent event) const { - static std::string empty(""); + static const std::string empty; SoundEvents::const_iterator i = mSounds.find(event); return (i == mSounds.end()) ? empty : diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 22be274a..3583bb27 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -33,7 +33,7 @@ const std::string &ItemInfo::getSprite(Gender gender) const } else { - static const std::string empty = ""; + static const std::string empty; std::map::const_iterator i = mAnimationFiles.find(gender); diff --git a/src/resources/userpalette.cpp b/src/resources/userpalette.cpp index 12ea3f8d..073f5b03 100644 --- a/src/resources/userpalette.cpp +++ b/src/resources/userpalette.cpp @@ -32,7 +32,7 @@ #include -const std::string ColorTypeNames[] = { +static const std::string ColorTypeNames[] = { "ColorBeing", "ColorPlayer", "ColorSelf", -- cgit v1.2.3-70-g09d2