1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-22 07:42:37 +00:00

refactor: avoid front() prior to loop (#7068)

* refactor: avoid `front()` prior to loop

* Update libtransmission/peer-mgr.cc

Co-authored-by: Yat Ho <lagoho7@gmail.com>

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
This commit is contained in:
Cœur 2024-08-23 17:34:44 +02:00 committed by GitHub
parent 3e5a77d176
commit 07172d9f4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1647,7 +1647,7 @@ uint64_t tr_peerMgrGetDesiredAvailable(tr_torrent const* tor)
return 0;
}
auto available = swarm->peers.front()->has();
auto available = tr_bitfield{ tor->piece_count() };
for (auto const* const peer : swarm->peers)
{
available |= peer->has();