mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
StringUtil: Make StringUTF8CodePointCount take string_view
There's nothing really about this that would need to constrain it to only std::string instances.
This commit is contained in:
@ -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; });
|
||||
|
Reference in New Issue
Block a user