Skip to content

Commit

Permalink
JNI: Don't use forwarding reference in ranged for
Browse files Browse the repository at this point in the history
The elements we iterate over are always jobjects, i.e. POD, so iterating
over values is at least as efficient, and less unnecessarily clever.

Pick-to: 6.7
Change-Id: I6142dab84f3d37d82613ecf27cc03dde7810e541
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
  • Loading branch information
vohi committed Feb 2, 2024
1 parent 35fbb65 commit 9f0dc59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/corelib/kernel/qjniarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class QJniArray : public QJniArrayBase
if constexpr (std::is_same_v<T, jobject>) {
QList<jobject> res;
res.reserve(size());
for (auto &&element : *this)
for (auto element : *this)
res.append(element);
return res;
} else if constexpr (std::is_same_v<T, jbyte>) {
Expand Down

0 comments on commit 9f0dc59

Please sign in to comment.