From 7206f6a39d298ed9c94bccf7bdc57498fa73ac36 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 7 Feb 2025 11:50:32 +0100 Subject: [PATCH] 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.9 6.8 6.5 Change-Id: I7b7178290bd30d93ed9e64b6b84294d0f7576c80 Reviewed-by: Ivan Solovev --- src/corelib/text/qstringbuilder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/text/qstringbuilder.h b/src/corelib/text/qstringbuilder.h index 853033b2d91..0b296d5142a 100644 --- a/src/corelib/text/qstringbuilder.h +++ b/src/corelib/text/qstringbuilder.h @@ -253,7 +253,7 @@ template <> struct QConcatenable : private QAbstractConcatenable { const qsizetype n = a.size(); if (n) - memcpy(out, reinterpret_cast(a.constData()), sizeof(QChar) * n); + memcpy(out, a.data(), sizeof(QChar) * n); out += n; } };