summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.cpp
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-09-29 10:44:00 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-10-10 00:53:48 -0700
commit72436a0d1f0c9c4c67f8763e0ec2f0941a975e02 (patch)
tree8dd4ac824d6d1afaea96df4509a0967bcc7fd358 /Source/Core/Common/StringUtil.cpp
parent7ce170f1385b114572fb9e71eeedfd5567784096 (diff)
Modernize `std::transform` with ranges
In StringUtil.h, the lambdas wrapping `Common::ToLower(char)` and `Common::ToUpper(char)` were only necessary due to the function names being overloaded.
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
-rw-r--r--Source/Core/Common/StringUtil.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp
index 9881708a27..d3e7caacdf 100644
--- a/Source/Core/Common/StringUtil.cpp
+++ b/Source/Core/Common/StringUtil.cpp
@@ -655,12 +655,12 @@ std::string GetEscapedHtml(std::string html)
void ToLower(std::string* str)
{
- std::transform(str->begin(), str->end(), str->begin(), [](char c) { return Common::ToLower(c); });
+ std::ranges::transform(*str, str->begin(), static_cast<char (&)(char)>(Common::ToLower));
}
void ToUpper(std::string* str)
{
- std::transform(str->begin(), str->end(), str->begin(), [](char c) { return Common::ToUpper(c); });
+ std::ranges::transform(*str, str->begin(), static_cast<char (&)(char)>(Common::ToUpper));
}
bool CaseInsensitiveEquals(std::string_view a, std::string_view b)