From 4cc5e1972ae5643af001276758c4456ee7292f41 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 21 Sep 2024 18:24:22 -0700 Subject: Modernize `std::count_if` with ranges --- Source/Core/Common/StringUtil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Source/Core/Common/StringUtil.cpp') 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 -- cgit v1.2.3