From bb8481e7520043e1c29636bb295bdd1a3b0b0449 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 10 Nov 2008 13:22:14 +0000 Subject: [PATCH] 2008-11-10 Tatsuhiro Tsujikawa Removed unused code. * src/DefaultBtAnnounce.cc --- ChangeLog | 5 +++++ src/DefaultBtAnnounce.cc | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 460d9eca..0e9b1374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-10 Tatsuhiro Tsujikawa + + Removed unused code. + * src/DefaultBtAnnounce.cc + 2008-11-10 Tatsuhiro Tsujikawa Fixed the bug that DefaultPieceStorage::getCompletedLength() returns diff --git a/src/DefaultBtAnnounce.cc b/src/DefaultBtAnnounce.cc index 3d16b892..5c00645c 100644 --- a/src/DefaultBtAnnounce.cc +++ b/src/DefaultBtAnnounce.cc @@ -132,10 +132,8 @@ std::string DefaultBtAnnounce::getAnnounceUrl() { numWant = 0; } TransferStat stat = peerStorage->calculateStat(); - uint64_t left = pieceStorage->getTotalLength()-pieceStorage->getCompletedLength(); - if(left < 0) { - left = 0; - } + uint64_t left = + pieceStorage->getTotalLength()-pieceStorage->getCompletedLength(); std::string url = announceList.getAnnounce()+ "?info_hash="+Util::torrentUrlencode(btContext->getInfoHash(), btContext->getInfoHashLength())+