Code Quality Improvement - Collection.isEmpty() should be used to test for emptiness

This commit is contained in:
Christian Ivan
2015-12-02 17:17:46 +07:00
parent 86898db7b1
commit d364404501
2 changed files with 3 additions and 3 deletions

View File

@@ -416,7 +416,7 @@ public class Manager extends Emitter {
/*package*/ void destroy(Socket socket) {
this.connected.remove(socket);
if (this.connected.size() > 0) return;
if (!this.connected.isEmpty()) return;
this.close();
}
@@ -447,7 +447,7 @@ public class Manager extends Emitter {
}
private void processPacketQueue() {
if (this.packetBuffer.size() > 0 && !this.encoding) {
if (!this.packetBuffer.isEmpty() && !this.encoding) {
Packet pack = this.packetBuffer.remove(0);
this.packet(pack);
}