From b731764c85cc9800e391ad0091f43aa70c022dba Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 11 Nov 2018 15:59:43 +0100 Subject: [PATCH] remove unused variables --- src/choker.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/choker.cpp b/src/choker.cpp index bcaff2c6c..e7e87e9c6 100644 --- a/src/choker.cpp +++ b/src/choker.cpp @@ -46,13 +46,6 @@ namespace { int compare_peers(peer_connection const* lhs, peer_connection const* rhs) { - // if one peer belongs to a higher priority torrent than the other one - // that one should be unchoked. - std::shared_ptr const t1 = lhs->associated_torrent().lock(); - std::shared_ptr const t2 = rhs->associated_torrent().lock(); - TORRENT_ASSERT(t1); - TORRENT_ASSERT(t2); - int const prio1 = lhs->get_priority(peer_connection::upload_channel); int const prio2 = rhs->get_priority(peer_connection::upload_channel); @@ -87,6 +80,8 @@ namespace { std::shared_ptr const t1 = lhs->associated_torrent().lock(); std::shared_ptr const t2 = rhs->associated_torrent().lock(); + TORRENT_ASSERT(t1); + TORRENT_ASSERT(t2); // if a peer is already unchoked, the number of bytes sent since it was unchoked // is greater than the send quanta, and it has been unchoked for at least one minute @@ -150,6 +145,8 @@ namespace { std::shared_ptr const t1 = lhs->associated_torrent().lock(); std::shared_ptr const t2 = rhs->associated_torrent().lock(); + TORRENT_ASSERT(t1); + TORRENT_ASSERT(t2); // the anti-leech seeding algorithm is based on the paper "Improving // BitTorrent: A Simple Approach" from Chow et. al. and ranks peers based