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)
|
sort_bittorrent_peer_connections(struct bittorrent_connection *bittorrent)
|
||||||
{
|
{
|
||||||
struct bittorrent_peer_connection *peer, *prev;
|
struct bittorrent_peer_connection *peer, *prev;
|
||||||
int resort = 0;
|
|
||||||
|
|
||||||
do {
|
while (1) {
|
||||||
struct bittorrent_peer_connection *next;
|
struct bittorrent_peer_connection *next;
|
||||||
|
int resort = 0;
|
||||||
|
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
resort = 0;
|
|
||||||
|
|
||||||
foreachsafe (peer, next, bittorrent->peers) {
|
foreachsafe (peer, next, bittorrent->peers) {
|
||||||
if (prev && prev->stats.download_rate < peer->stats.download_rate) {
|
if (prev && prev->stats.download_rate < peer->stats.download_rate) {
|
||||||
@ -72,7 +71,8 @@ sort_bittorrent_peer_connections(struct bittorrent_connection *bittorrent)
|
|||||||
prev = peer;
|
prev = peer;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (resort);
|
if (!resort) break;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG
|
#ifdef CONFIG_DEBUG
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user