QByteArray benchmark: fix clang -Wmove-result

Take the argument by value instead of rvalue ref. In C++17, this is as
efficient, and enables the

   return big;

to use the QByteArray move constructor, avoiding the need for a manual
std::move(), which always looks suspicious on a return statement,
because more often than not, it's a pessimization that breaks NRVO.

This code doesn't seem to exist in Qt 6.2, so only

Pick-to: 6.3
Change-Id: I8bf678102f5df1870cfc61090d12f327478d74d1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2022-01-22 21:18:15 +01:00
parent 6f1821dfa3
commit a8f00bf0ad

View File

@ -91,7 +91,7 @@ void tst_QByteArray::append()
}
}
static QByteArray decNext(QByteArray &&big)
static QByteArray decNext(QByteArray big)
{
// Increments a decimal digit-string (ignoring sign, so decrements if
// negative); only intended for taking a boundary value just out of range,