From 74b745e8764b48c405272ecc919f8bca4b9706ac Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 17 Jan 2012 02:27:20 +0000 Subject: [PATCH] back port torrent sorting fix into trunk --- examples/client_test.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/client_test.cpp b/examples/client_test.cpp index e4334c9e3..d46342ccc 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -292,7 +292,10 @@ bool compare_torrent(torrent_status const* lhs, torrent_status const* rhs) else if (lhs->queue_position == -1 && rhs->queue_position == -1) { // both are seeding, sort by seed-rank - return lhs->seed_rank > rhs->seed_rank; + if (lhs->seed_rank != rhs->seed_rank) + return lhs->seed_rank > rhs->seed_rank; + + return lhs->info_hash < rhs->info_hash; } return (lhs->queue_position == -1) < (rhs->queue_position == -1);