diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-22 21:18:15 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-24 21:11:22 +0100 |
commit | a8f00bf0ad864afc25986c0132d3397d785eb9fe (patch) | |
tree | 956bf2bf0c7cde022ab84382b1026b6aae2803a9 /tests/benchmarks/corelib | |
parent | 6f1821dfa302c028f7899e4485dfaf24a6a02457 (diff) |
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>
Diffstat (limited to 'tests/benchmarks/corelib')
-rw-r--r-- | tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp index 01ee46c53e..a98503210c 100644 --- a/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp +++ b/tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp @@ -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, |