kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: MINOR: remove unnecessary null check
Date Tue, 27 Jun 2017 22:29:51 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 031da889b -> 1d28e2574


MINOR: remove unnecessary null check

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #3445 from mjsax/minor-remove-null-check


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

Branch: refs/heads/trunk
Commit: 1d28e25748024d78dcc1a35c825ce5eef0dfd30d
Parents: 031da88
Author: Matthias J. Sax <matthias@confluent.io>
Authored: Tue Jun 27 15:29:48 2017 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Jun 27 15:29:48 2017 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/serializer/Encoder.scala | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/1d28e257/core/src/main/scala/kafka/serializer/Encoder.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/serializer/Encoder.scala b/core/src/main/scala/kafka/serializer/Encoder.scala
index 00e2d94..b1277e1 100644
--- a/core/src/main/scala/kafka/serializer/Encoder.scala
+++ b/core/src/main/scala/kafka/serializer/Encoder.scala
@@ -64,10 +64,7 @@ class StringEncoder(props: VerifiableProperties = null) extends Encoder[String]
   */
 class LongEncoder(props: VerifiableProperties = null) extends Encoder[Long] {
   override def toBytes(l: Long): Array[Byte] =
-    if(l == null)
-      null
-    else
-      ByteBuffer.allocate(8).putLong(l).array()
+    ByteBuffer.allocate(8).putLong(l).array()
 }
 
 /**


Mime
View raw message