From 1d03835c5dd00dbc855f3afbbad7b21ee2919929 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Jan 2023 16:55:41 -0500 Subject: StringUtil: Make StringUTF8CodePointCount take string_view There's nothing really about this that would need to constrain it to only std::string instances. --- Source/Core/Common/StringUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/StringUtil.cpp') diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 1bfb54e9f9..1277a18f72 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -437,7 +437,7 @@ void StringPopBackIf(std::string* s, char c) s->pop_back(); } -size_t StringUTF8CodePointCount(const std::string& str) +size_t StringUTF8CodePointCount(std::string_view str) { return str.size() - std::count_if(str.begin(), str.end(), [](char c) -> bool { return (c & 0xC0) == 0x80; }); -- cgit v1.2.3