QStringBuilder: remove an unneeded cast

memcpy() takes void*, not char*, so the cast from QChar* to char* is
not necessary (and potentially harmful).

Amends the start of the public history.

Pick-to: 6.8 6.5
Change-Id: I7b7178290bd30d93ed9e64b6b84294d0f7576c80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7206f6a39d298ed9c94bccf7bdc57498fa73ac36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2025-02-07 11:50:32 +01:00 committed by Qt Cherry-pick Bot
parent 267acbc534
commit 0e5e850691

View File

@ -253,7 +253,7 @@ template <> struct QConcatenable<QString> : private QAbstractConcatenable
{
const qsizetype n = a.size();
if (n)
memcpy(out, reinterpret_cast<const char*>(a.constData()), sizeof(QChar) * n);
memcpy(out, a.data(), sizeof(QChar) * n);
out += n;
}
};