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:
parent
3e5a77d176
commit
07172d9f4f
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue