From a73f10aee422bbbee22c63ff1c436cb3193938e6 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 16 Jan 2024 12:52:01 +0100 Subject: [PATCH] QFont::Tag: optimize toString by not searching for terminating null The compiler knows how large the array is, so pass the size and drop the terminating null. Pick-to: 6.7 Change-Id: I5795c89834b8395f04d1777d737d080f19be2a21 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Konstantin Ritt --- src/gui/text/qfont.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 653b123c94..ace07780b5 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -231,9 +231,8 @@ public: char((m_value & 0xff000000) >> 24), char((m_value & 0x00ff0000) >> 16), char((m_value & 0x0000ff00) >> 8), - char((m_value & 0x000000ff)), - 0 }; - return QByteArray(data); + char((m_value & 0x000000ff)) }; + return QByteArray(data, sizeof(data)); } static constexpr std::optional fromValue(quint32 value) noexcept