Skip to content

Commit

Permalink
[ARMT] improved CCommon::StrToLower
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey McRae committed Nov 4, 2012
1 parent e48b7b4 commit b03eff0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions common/CCommon.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ std::string CCommon::IntToStr(int value, int base/* = 10*/)
return buf; return buf;
} }


std::string CCommon::StrToLower(const std::string &string) std::string CCommon::StrToLower(std::string string)
{ {
std::string result = string; std::transform(string.begin(), string.end(), string.begin(), ::tolower);
std::transform(result.begin(), result.end(), result.begin(), ::tolower); return string;
return result;
} }


bool CCommon::IsFile(const std::string &path) bool CCommon::IsFile(const std::string &path)
Expand Down
2 changes: 1 addition & 1 deletion common/CCommon.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CCommon
static bool IsBE() { return m_isBE; } static bool IsBE() { return m_isBE; }
static void Trim (std::string &s); static void Trim (std::string &s);
static std::string IntToStr(int value, int base = 10); static std::string IntToStr(int value, int base = 10);
static std::string StrToLower(const std::string &string); static std::string StrToLower(std::string string);


static const std::string &GetExePath () { return m_exePath ; } static const std::string &GetExePath () { return m_exePath ; }
static const std::string &GetBasePath() { return m_basePath; } static const std::string &GetBasePath() { return m_basePath; }
Expand Down

0 comments on commit b03eff0

Please sign in to comment.