mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
http_private: make TorrentMap cleaning logic more readable
This commit is contained in:
parent
1b2009ba60
commit
e228f5a4c2
1 changed files with 5 additions and 5 deletions
|
|
@ -107,9 +107,9 @@ impl TorrentMaps {
|
|||
let num_leechers = &mut torrent_data.num_leechers;
|
||||
|
||||
torrent_data.peers.retain(|_, peer| {
|
||||
let keep = peer.valid_until.0 >= now;
|
||||
|
||||
if !keep {
|
||||
if peer.valid_until.0 >= now {
|
||||
true
|
||||
} else {
|
||||
match peer.status {
|
||||
PeerStatus::Seeding => {
|
||||
*num_seeders -= 1;
|
||||
|
|
@ -119,9 +119,9 @@ impl TorrentMaps {
|
|||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
||||
keep
|
||||
false
|
||||
}
|
||||
});
|
||||
|
||||
!torrent_data.peers.is_empty()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue