kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkr...@apache.org
Subject [1/2] kafka git commit: KAFKA-2050 Avoid calling .size() on linked list.
Date Sat, 04 Apr 2015 22:32:11 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 6adaffd8e -> a686a67f6


KAFKA-2050 Avoid calling .size() on linked list.


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/70e5c92e
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/70e5c92e
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/70e5c92e

Branch: refs/heads/trunk
Commit: 70e5c92e213bff7502288c610c252735d6b68c08
Parents: 6adaffd
Author: Tim Brooks <tim.brooks@staples.com>
Authored: Sat Apr 4 15:17:09 2015 -0700
Committer: Jay Kreps <jay.kreps@gmail.com>
Committed: Sat Apr 4 15:17:09 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/network/SocketServer.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/70e5c92e/core/src/main/scala/kafka/network/SocketServer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/network/SocketServer.scala b/core/src/main/scala/kafka/network/SocketServer.scala
index 07ce58e..578283b 100644
--- a/core/src/main/scala/kafka/network/SocketServer.scala
+++ b/core/src/main/scala/kafka/network/SocketServer.scala
@@ -429,7 +429,7 @@ private[kafka] class Processor(val id: Int,
    * Register any new connections that have been queued up
    */
   private def configureNewConnections() {
-    while(newConnections.size() > 0) {
+    while(!newConnections.isEmpty) {
       val channel = newConnections.poll()
       debug("Processor " + id + " listening to new connection from " + channel.socket.getRemoteSocketAddress)
       channel.register(selector, SelectionKey.OP_READ)


Mime
View raw message