From a8f00bf0ad864afc25986c0132d3397d785eb9fe Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 22 Jan 2022 21:18:15 +0100 Subject: 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 --- tests/benchmarks/corelib/text/qbytearray/tst_bench_qbytearray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/benchmarks') 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, -- cgit v1.2.3