diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-23 10:47:35 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-23 13:35:16 +0200 |
commit | f0463f0cc6e2091bc1797d0fc18cb538f7ec2cd0 (patch) | |
tree | 0215b7d3a30ed5b8a10728ace497b980edde42d2 /examples/network/torrent | |
parent | 54590c4f8acc8e1be24a1d4d4bb0d716018c9ba0 (diff) |
Torrent example: add missing qAsConst()
The function is const, but the d-pointer doesn't propagate it (raw pointer),
so we need the qAsConst() even here.
Change-Id: I9d2e1f7715abb3dc67a87cdadaa7ded971b15848
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'examples/network/torrent')
-rw-r--r-- | examples/network/torrent/torrentclient.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp index b5ebad54f4..bd050153a4 100644 --- a/examples/network/torrent/torrentclient.cpp +++ b/examples/network/torrent/torrentclient.cpp @@ -720,9 +720,9 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const qint64 now = QDateTime::currentSecsSinceEpoch(); QList<TorrentPeer *> freePeers; QMap<QString, int> connectionsPerPeer; - for (TorrentPeer *peer : d->peers) { + for (TorrentPeer *peer : qAsConst(d->peers)) { bool busy = false; - for (PeerWireClient *client : d->connections) { + for (PeerWireClient *client : qAsConst(d->connections)) { if (client->state() == PeerWireClient::ConnectedState && client->peerAddress() == peer->address && client->peerPort() == peer->port) { |