diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-03-22 15:45:51 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-03-31 10:32:45 +0100 |
commit | 0eccfe5e390ca967f4c5cbc4093c9e50bbce9c33 (patch) | |
tree | 2e71675732e73b7b505c14ac407aea64a5331d9a | |
parent | f1b264f9ac05205f6134d984c221af5ad8b3ba81 (diff) |
tst_bench_QCryptographicHash: port from std::function to qxp::function_ref
Because we can, and because function_ref is never null.
Pick-to: 6.5
Change-Id: If71f98860d72eaa8cf8a93bb3c59a0260d3c7660
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp index 350474aa90..2127298f59 100644 --- a/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp +++ b/tests/benchmarks/corelib/tools/qcryptographichash/tst_bench_qcryptographichash.cpp @@ -11,7 +11,7 @@ #include <QString> #include <QTest> -#include <functional> +#include <qxpfunctional.h> #include <numeric> #include <time.h> @@ -45,9 +45,8 @@ private Q_SLOTS: const int MaxBlockSize = 65536; -static void for_each_algorithm(std::function<void(QCryptographicHash::Algorithm, const char*)> f) +static void for_each_algorithm(qxp::function_ref<void(QCryptographicHash::Algorithm, const char*) const> f) { - Q_ASSERT(f); using A = QCryptographicHash::Algorithm; static const auto metaEnum = QMetaEnum::fromType<A>(); for (int i = 0, value = metaEnum.value(i); value != -1; value = metaEnum.value(++i)) |