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 9dd8e655cd
("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 <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2022-01-10 17:20:23 -08:00 committed by Marc Mutz
parent cd446a7e25
commit 8623e8ed08

View File

@ -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 <typename T>
Q_NEVER_INLINE
static QByteArray toCase_template(T &input, uchar (*lookup)(uchar))
{
// find the first bad character in input