summaryrefslogtreecommitdiff
path: root/src/shared/util.cpp
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-08-14 11:35:20 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-12-12 20:16:50 -0600
commit49159de5d7084bf1ac159e3e37e2b406cdd87dbf (patch)
treeeee325c67516bd360f672683daa13d494f8b19da /src/shared/util.cpp
parent75a663941d5a58b9676e2eb99a2a288abc19a359 (diff)
Improved refresh performance by replacing std::transform() with CharLowerBuffer().
Fixed padding to four spaces and removed references to FLAG_ARCHIVE_LOOSE_CONFLICTS_MIXED that isn't used.
Diffstat (limited to 'src/shared/util.cpp')
-rw-r--r--src/shared/util.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/shared/util.cpp b/src/shared/util.cpp
index 102565f5..b65ed071 100644
--- a/src/shared/util.cpp
+++ b/src/shared/util.cpp
@@ -108,27 +108,31 @@ static auto locToLower = [] (char in) -> char {
std::string &ToLower(std::string &text)
{
- std::transform(text.begin(), text.end(), text.begin(), locToLower);
+ //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 result(text);
- std::transform(result.begin(), result.end(), result.begin(), locToLower);
+ //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::transform(text.begin(), text.end(), text.begin(), locToLowerW);
+ //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 result(text);
- std::transform(result.begin(), result.end(), result.begin(), locToLowerW);
+ //std::transform(result.begin(), result.end(), result.begin(), locToLowerW);
+ CharLowerBuffW(const_cast<WCHAR *>(result.c_str()), static_cast<DWORD>(result.size()));
return result;
}