mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
sort_bittorrent_peer_connections(): make @resort variable local to
the loop.
This commit is contained in:
parent
852bdaec88
commit
f331c7ac85
@ -54,13 +54,12 @@ static void
|
||||
sort_bittorrent_peer_connections(struct bittorrent_connection *bittorrent)
|
||||
{
|
||||
struct bittorrent_peer_connection *peer, *prev;
|
||||
|
||||
while (1) {
|
||||
struct bittorrent_peer_connection *next;
|
||||
int resort = 0;
|
||||
|
||||
do {
|
||||
struct bittorrent_peer_connection *next;
|
||||
|
||||
prev = NULL;
|
||||
resort = 0;
|
||||
|
||||
foreachsafe (peer, next, bittorrent->peers) {
|
||||
if (prev && prev->stats.download_rate < peer->stats.download_rate) {
|
||||
@ -72,7 +71,8 @@ sort_bittorrent_peer_connections(struct bittorrent_connection *bittorrent)
|
||||
prev = peer;
|
||||
}
|
||||
|
||||
} while (resort);
|
||||
if (!resort) break;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
prev = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user