diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-21 18:24:22 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-10-10 00:53:48 -0700 |
| commit | 4cc5e1972ae5643af001276758c4456ee7292f41 (patch) | |
| tree | 3cc94925d1442876440114326f6b341ddfb90d9d /Source/Core/Common/StringUtil.cpp | |
| parent | c46060e2985f24a6668db1061681009997aef896 (diff) | |
Modernize `std::count_if` with ranges
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 508ba8baf8..9881708a27 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -403,8 +403,7 @@ void StringPopBackIf(std::string* s, char c) size_t StringUTF8CodePointCount(std::string_view str) { - return str.size() - - std::count_if(str.begin(), str.end(), [](char c) -> bool { return (c & 0xC0) == 0x80; }); + return str.size() - std::ranges::count_if(str, [](char c) -> bool { return (c & 0xC0) == 0x80; }); } #ifdef _WIN32 |
