summaryrefslogtreecommitdiff
path: root/src/shared/util.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-12-19 23:00:18 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-02-04 03:33:19 -0500
commit2be531470d54fa56307e392ad5bdfbc02048a744 (patch)
tree4ab9e436d40b1650fdce9378bdef83b970cd2136 /src/shared/util.cpp
parent0a908c49625fe0e54bc45e29fe8c4908d20b0dbe (diff)
renamed ToLower() to avoid confusion with in-place vs copy
pre-hashed file lookup in DirectoryEntry
Diffstat (limited to 'src/shared/util.cpp')
-rw-r--r--src/shared/util.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
index 4ac95465..009aad70 100644
--- a/src/shared/util.cpp
+++ b/src/shared/util.cpp
@@ -102,32 +102,28 @@ static auto locToLower = [] (char in) -> char {
return std::tolower(in, loc);
};
-std::string &ToLower(std::string &text)
+std::string& ToLowerInPlace(std::string& text)
{
- //std::transform(text.begin(), text.end(), text.begin(), locToLower);
CharLowerBuffA(const_cast<CHAR *>(text.c_str()), static_cast<DWORD>(text.size()));
return text;
}
-std::string ToLower(const std::string &text)
+std::string ToLowerCopy(const std::string& text)
{
std::string result(text);
- //std::transform(result.begin(), result.end(), result.begin(), locToLower);
CharLowerBuffA(const_cast<CHAR *>(result.c_str()), static_cast<DWORD>(result.size()));
return result;
}
-std::wstring &ToLower(std::wstring &text)
+std::wstring& ToLowerInPlace(std::wstring& text)
{
- //std::transform(text.begin(), text.end(), text.begin(), locToLowerW);
CharLowerBuffW(const_cast<WCHAR *>(text.c_str()), static_cast<DWORD>(text.size()));
return text;
}
-std::wstring ToLower(const std::wstring &text)
+std::wstring ToLowerCopy(const std::wstring& text)
{
std::wstring result(text);
- //std::transform(result.begin(), result.end(), result.begin(), locToLowerW);
CharLowerBuffW(const_cast<WCHAR *>(result.c_str()), static_cast<DWORD>(result.size()));
return result;
}