summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2024-01-16 12:52:01 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2024-01-19 13:58:57 +0100
commita73f10aee422bbbee22c63ff1c436cb3193938e6 (patch)
tree3c06d327788ef48ed61b1570f347d20e21ed9a16 /src/gui/text
parent88c3cd6e08c86bfb5bb676ceed4c92344f8ed91c (diff)
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 <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfont.h5
1 files 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<Tag> fromValue(quint32 value) noexcept