QFutureInterface::reportAndMoveResult(): don't spell a move as forward<T>()

The T&& result argument is not deduced (T is the template class'
template argument, so it's an rvalue reference, not a Universal
Reference, assuming that we don't support QFutureInterface<U> where U
is a reference type).

So std::forward<T> will always be a std::move(), so use that directly
instead of raising eyebrows in the reader of the code by using
forward<> to feed a function called _move_Result().

Pick-to: 6.5
Change-Id: I805df4686b5b74da57f8212b052b4056943a15fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Marc Mutz 2023-03-27 22:14:04 +02:00
parent 10e106ae47
commit 02e2682ee8

View File

@ -311,7 +311,7 @@ bool QFutureInterface<T>::reportAndMoveResult(T &&result, int index)
QtPrivate::ResultStoreBase &store = resultStoreBase();
const int oldResultCount = store.count();
const int insertIndex = store.moveResult(index, std::forward<T>(result));
const int insertIndex = store.moveResult(index, std::move(result));
// Let's make sure it's not in pending results.
if (insertIndex != -1 && (!store.filterMode() || oldResultCount < store.count()))
reportResultsReady(insertIndex, store.count());