From c67f010302dadeb533202353686e2a7e3244a08d Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 18 Sep 2012 05:01:34 +0200 Subject: [PATCH] Pass filename by reference when possible. --- indra/newview/lllogchat.cpp | 4 ++-- indra/newview/lllogchat.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 574d70f4b..e80032239 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -99,7 +99,7 @@ std::string LLLogChat::timestamp(bool withdate) //static -void LLLogChat::saveHistory(std::string filename, std::string line) +void LLLogChat::saveHistory(std::string const& filename, std::string line) { if(!filename.size()) { @@ -120,7 +120,7 @@ void LLLogChat::saveHistory(std::string filename, std::string line) } } -void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType,std::string,void*), void* userdata) +void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType,std::string,void*), void* userdata) { if(!filename.size()) { diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index ad903b66f..84f6760ab 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -34,6 +34,8 @@ #ifndef LL_LLLOGCHAT_H #define LL_LLLOGCHAT_H +#include + class LLLogChat { public: @@ -44,9 +46,9 @@ public: LOG_END }; static std::string timestamp(bool withdate = false); - static std::string makeLogFileName(std::string(filename)); - static void saveHistory(std::string filename, std::string line); - static void loadHistory(std::string filename, + static std::string makeLogFileName(std::string filename); + static void saveHistory(std::string const& filename, std::string line); + static void loadHistory(std::string const& filename, void (*callback)(ELogLineType,std::string,void*), void* userdata); private: