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>
parent
54590c4f8a
commit
f0463f0cc6
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue