* Replace size() <= 0 with isEmpty() everywhere, ditto > 0 -> !isEmpty()

This commit is contained in:
zzz
2010-05-05 16:51:54 +00:00
parent 16bec08f09
commit 2baee7413c
90 changed files with 158 additions and 154 deletions

View File

@ -355,7 +355,7 @@ public class I2PSnarkUtil {
while (tok.hasMoreTokens())
rv.add(tok.nextToken());
if (rv.size() <= 0)
if (rv.isEmpty())
return null;
return rv;
}

View File

@ -142,7 +142,7 @@ class PeerConnectionOut implements Runnable
it.remove();
}
}
if (m == null && sendQueue.size() > 0) {
if (m == null && !sendQueue.isEmpty()) {
m = (Message)sendQueue.remove(0);
SimpleTimer.getInstance().removeEvent(m.expireEvent);
}

View File

@ -272,7 +272,7 @@ public class PeerCoordinator implements PeerListener
peerCount = 0;
}
while (removed.size() > 0) {
while (!removed.isEmpty()) {
Peer peer = (Peer)removed.remove(0);
peer.disconnect();
removePeerFromPieces(peer);
@ -428,7 +428,7 @@ public class PeerCoordinator implements PeerListener
}
}
while (uploaders < maxUploaders && interested.size() > 0)
while (uploaders < maxUploaders && !interested.isEmpty())
{
Peer peer = (Peer)interested.remove(0);
if (_log.shouldLog(Log.DEBUG))

View File

@ -163,7 +163,7 @@ public class TrackerClient extends I2PAppThread
}
}
if (tlist.size() <= 0) {
if (tlist.isEmpty()) {
// FIXME really need to get this message to the gui
stop = true;
_log.error("No valid trackers for infoHash: " + infoHash);