The rarest-first sort is stable, so randomize the wantedPieces list to ensure a healthy swarm when you have mostly seeders.

This commit is contained in:
ragnarok
2005-10-20 22:31:28 +00:00
committed by zzz
parent 05e2da7c22
commit 0b9e4967a0
2 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@ public class Piece implements Comparable {
public Piece(int id) {
this.id = id;
this.peers = new HashSet();
this.requested = false;
}
public int compareTo(Object o) throws ClassCastException {