From c08050a074c334ac4b1191fab74ccb10680f2de2 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 14 Feb 2007 15:41:01 +0000 Subject: [PATCH] combined essentially the same code (an extra conversion and multiplication shouldn't hurt) --- macosx/Torrent.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 540d01ce9..6c987e4d5 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1343,12 +1343,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 //determine percentage finished and available int have, avail; - if ([self progress] >= 1.0) - { - have = MAX_PIECES; - avail = 0; - } - else if (![self isActive] || [self totalPeers] <= 0) + if ([self progress] >= 1.0 || ![self isActive] || [self totalPeers] <= 0) { have = rintf((float)MAX_PIECES * [self progress]); avail = 0; @@ -1360,10 +1355,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 float available = 0; for (i = 0; i < pieceCount; i++) - { if (piecesAvailablity[i] > 0) available += 1.0 - piecesFinished[i]; - } have = rintf((float)MAX_PIECES * [self progress]); avail = rintf((float)MAX_PIECES * available / (float)pieceCount);