Pass some const strings by reference
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 17 Oct 2011 09:21:07 +0000 (11:21 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 17 Oct 2011 09:21:07 +0000 (11:21 +0200)
src/i18n.cpp
src/i18n.h
src/logfunc.cpp
src/logfunc.hpp

index 392e8d3..e0d7c44 100644 (file)
@@ -205,7 +205,7 @@ void i18n_get_string(const string &source, string &target, const vector<string>
 }
 
 // convert locale to language (de_DE -> de)
-string i18n_locale2language(string locale)
+string i18n_locale2language(const string &locale)
 {
     // search for "_"
     string::size_type pos = locale.find("_");
index 5d1a699..67c4b8c 100644 (file)
@@ -45,6 +45,6 @@ void i18n_get_string (const std::string &source, std::string &target, const std:
 std::string i18n_get_string (const char *source, const std::vector<std::string> &data);
 std::string i18n_get_string (const std::string &source, const std::vector<std::string> &data);
 
-std::string i18n_locale2language(const std::string locale);
+std::string i18n_locale2language(const std::string &locale);
 
 #endif
index 8b1ce4f..dc49388 100644 (file)
@@ -475,7 +475,7 @@ PartLogger::~PartLogger()
  * @param level the log level.
  * @param msg the log message.
  */
-void PartLogger::log(int level, const std::string msg)
+void PartLogger::log(int level, const std::string &msg)
 {
     boost::recursive_mutex::scoped_lock lock(LoggerLock);
 
index 1073f38..6c0cc3c 100644 (file)
@@ -153,7 +153,7 @@ class PartLogger
         PartLogger( const SourceLocation& loc );
         virtual ~PartLogger();
 
-        void log(int level, const std::string msg);
+        void log(int level, const std::string &msg);
 
         void fatal(const std::string& msg);
         void alert(const std::string& msg);