From bfc6e2d69d2514f7b4e889d08475972eb2f340a6 Mon Sep 17 00:00:00 2001 From: Andrei Golubev Date: Mon, 12 Oct 2020 16:29:27 +0200 Subject: Use parameter_type in QList methods QList::parameter_type is defined and used to give better performance e.g. for arithmetic types. Let's use it consistently in QList API instead of const T & Change-Id: I2e12bd83f55679b55a14fbb23ab6172a9cf7bbcc Reviewed-by: Thiago Macieira --- .../concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp | 10 ++++++---- tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp index 28e83fbee5..ac6869eee9 100644 --- a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp +++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp @@ -403,8 +403,9 @@ void tst_QtConcurrentFilter::filteredReduced() const int intSum = 6; // sum of even values const Number numberSum = 6; // sum of even values - void (QList::*pushBackInt)(const int &) = &QList::push_back; - void (QList::*pushBackNumber)(const Number &) = &QList::push_back; + void (QList::*pushBackInt)(QList::parameter_type) = &QList::push_back; + void (QList::*pushBackNumber)(QList::parameter_type) = + &QList::push_back; auto lambdaIsEven = [](const int &x) { return (x & 1) == 0; @@ -703,8 +704,9 @@ void tst_QtConcurrentFilter::filteredReducedInitialValue() const int intSum = 16; // sum of even values and initial value const Number numberSum = 16; // sum of even values and initial value - void (QList::*pushBackInt)(const int &) = &QList::push_back; - void (QList::*pushBackNumber)(const Number &) = &QList::push_back; + void (QList::*pushBackInt)(QList::parameter_type) = &QList::push_back; + void (QList::*pushBackNumber)(QList::parameter_type) = + &QList::push_back; auto lambdaIsEven = [](const int &x) { return (x & 1) == 0; diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp index 804f14e628..06446321b3 100644 --- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp @@ -718,7 +718,7 @@ void tst_QtConcurrentMap::mappedReduced() const int sum = 6; const int sumOfSquares = 14; - void (QList::*push_back)(const int &) = &QList::push_back; + void (QList::*push_back)(QList::parameter_type) = &QList::push_back; auto lambdaSquare = [](int x) { return x * x; @@ -1009,7 +1009,7 @@ void tst_QtConcurrentMap::mappedReducedInitialValue() const int sumOfSquares = 24; const int intInitial = 10; - void (QList::*push_back)(const int &) = &QList::push_back; + void (QList::*push_back)(QList::parameter_type) = &QList::push_back; auto lambdaSquare = [](int x) { return x * x; -- cgit v1.2.3