From f331171dd734a565f649f6eade46fd71a38c92cf Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 31 Oct 2023 11:14:21 +0300 Subject: [PATCH] QString::fill: port to char16_t Change-Id: If91ea7b7ceedbf9ed109b064ea5ea5572e7c9b14 Reviewed-by: Thiago Macieira --- src/corelib/text/qstring.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 04bb83f3b56..93e541e7129 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -6225,11 +6225,8 @@ void QString::chop(qsizetype n) QString& QString::fill(QChar ch, qsizetype size) { resize(size < 0 ? d.size : size); - if (d.size) { - QChar *i = (QChar*)d.data() + d.size; - QChar *b = (QChar*)d.data(); - std::fill(b, i, ch); - } + if (d.size) + std::fill(d.data(), d.data() + d.size, ch.unicode()); return *this; }