From 8623e8ed08b57ec4fe17fffbca9c5f53a551670e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 10 Jan 2022 17:20:23 -0800 Subject: [PATCH] QByteArray: remove left-over Q_NEVER_INLINE after we removed the tables The comment made a reference to the case tables that used to exist in qbytearray.cpp prior to commit 9dd8e655cdd26eeaae30645b7fe013d9a696547f ("Limit QByteArray's 8-bit support to ASCII"). Now that the parameter is a function pointer, not a table, inlining is actually beneficial: we definitely don't want the compiler to emit function calls via the function pointer. At least GCC 11 was already doing constant-propagation of the parameter: While it didn't inline the function, it cloned it and propagated the constant in each of the two clones. There were 4 copies of this function: const and non-const, upper and lower. Change-Id: I0e5f6bec596a4a78bd3bfffd16c912a16602e20a Reviewed-by: Marc Mutz Reviewed-by: Edward Welbourne --- src/corelib/text/qbytearray.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index e339f2fef5b..1966f24149c 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -2966,11 +2966,7 @@ QByteArray QByteArray::mid(qsizetype pos, qsizetype len) const \sa isLower(), toUpper(), {Character Case} */ -// prevent the compiler from inlining the function in each of -// toLower and toUpper when the only difference is the table being used -// (even with constant propagation, there's no gain in performance). template -Q_NEVER_INLINE static QByteArray toCase_template(T &input, uchar (*lookup)(uchar)) { // find the first bad character in input