diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-01-22 21:34:46 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-01-24 21:11:22 +0100 |
commit | c00e443dcc5024aa1239ed2f494da13ab572d238 (patch) | |
tree | 3bac72c2703997851b5a7c227598785b200183aa /tests/benchmarks | |
parent | b084c885dbaf1c89189c03a9466984648c0f5835 (diff) |
tst_bench_qlocalsocket: fix Clang 10 warnings about unneeded capture
The timeToTest constant doesn't need to be captured, claims Clang.
Since I don't recall seeing this warning on GCC, be pragmatic and fix
by letting the compiler choose what to capture: [&]. timeToTest is
const, so it doesn't matter whether we capture by reference or value,
the lambda cannot change it either way.
This code doesn't seem to exist in 5.15, so merely
Pick-to: 6.3 6.2
Change-Id: I48d42ab13ed22ac5eb512dc61235b72a19636ea3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 7130895f51..c04a0228f9 100644 --- a/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/benchmarks/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -212,8 +212,7 @@ void tst_QLocalSocket::dataExchange() qint64 totalReceived = 0; QElapsedTimer timer; - connect(&factory, &SocketFactory::bytesReceived, - [&totalReceived, &timer, timeToTest, &factory, &eventLoop](int channel, qint64 bytes) { + connect(&factory, &SocketFactory::bytesReceived, [&](int channel, qint64 bytes) { Q_UNUSED(channel); totalReceived += bytes; |