summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-01-25 02:33:22 +0100
committerGitHub <noreply@github.com>2023-01-25 02:33:22 +0100
commit6db2171fd0365d40e7ee86f2a46faa053f0553db (patch)
treeb08bbc3a656a1aa72793be24a82f930b19662e0f /Source/Core
parent9fc959cab048c09d5e9af2bbe33c74e8d9dd09e1 (diff)
parent1d03835c5dd00dbc855f3afbbad7b21ee2919929 (diff)
Merge pull request #11488 from lioncash/point
StringUtil: Make StringUTF8CodePointCount take string_view
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/StringUtil.cpp2
-rw-r--r--Source/Core/Common/StringUtil.h2
2 files changed, 2 insertions, 2 deletions
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; });
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index cb58f9fa25..3ae97e5562 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -170,7 +170,7 @@ std::string WithUnifiedPathSeparators(std::string path);
std::string PathToFileName(std::string_view path);
void StringPopBackIf(std::string* s, char c);
-size_t StringUTF8CodePointCount(const std::string& str);
+size_t StringUTF8CodePointCount(std::string_view str);
std::string CP1252ToUTF8(std::string_view str);
std::string SHIFTJISToUTF8(std::string_view str);