1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

avoid some calculations of piece availability if there are no peers

This commit is contained in:
Mitchell Livingston 2007-02-14 02:05:46 +00:00
parent 7d569e7981
commit 60d0c333ff

View file

@ -1348,7 +1348,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
have = MAX_PIECES; have = MAX_PIECES;
avail = 0; avail = 0;
} }
else if (![self isActive]) else if (![self isActive] || [self totalPeers] <= 0)
{ {
have = rintf((float)MAX_PIECES * [self progress]); have = rintf((float)MAX_PIECES * [self progress]);
avail = 0; avail = 0;