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>
Marc Mutz 2019-05-23 10:47:35 +02:00
parent 54590c4f8a
commit f0463f0cc6
1 changed files with 2 additions and 2 deletions

View File

@ -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) {