Codechange: Use Utf8View in Utf8StringLength.

This commit is contained in:
frosch
2025-04-01 18:21:03 +02:00
committed by frosch
parent 83401ad5e2
commit f19e75b606
4 changed files with 17 additions and 19 deletions

View File

@@ -444,7 +444,7 @@ void Textbuf::Assign(const std::string_view text)
*/
void Textbuf::UpdateSize()
{
this->chars = static_cast<uint16_t>(Utf8StringLength(this->buf.c_str()) + 1); // terminating zero
this->chars = static_cast<uint16_t>(Utf8StringLength(this->buf) + 1); // terminating zero
assert(this->buf.size() < this->max_bytes);
assert(this->chars <= this->max_chars);