Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2BA2F200B9C for ; Mon, 26 Sep 2016 07:42:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2A2FC160AE2; Mon, 26 Sep 2016 05:42:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 635E2160ACE for ; Mon, 26 Sep 2016 07:42:25 +0200 (CEST) Received: (qmail 56907 invoked by uid 500); 26 Sep 2016 05:42:19 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 56898 invoked by uid 99); 26 Sep 2016 05:42:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2016 05:42:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3B581E0381; Mon, 26 Sep 2016 05:42:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anoopsamjohn@apache.org To: commits@hbase.apache.org Message-Id: <536631ae37314d1abe5b79c98350e1b8@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hbase git commit: HBASE-16705 Eliminate long to Long auto boxing in LongComparator. (binlijin) Date: Mon, 26 Sep 2016 05:42:18 +0000 (UTC) archived-at: Mon, 26 Sep 2016 05:42:26 -0000 Repository: hbase Updated Branches: refs/heads/master b7e0e1578 -> da37fd9cd HBASE-16705 Eliminate long to Long auto boxing in LongComparator. (binlijin) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/da37fd9c Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/da37fd9c Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/da37fd9c Branch: refs/heads/master Commit: da37fd9cdc9cd3bffa6a863be45dff4ba49be89e Parents: b7e0e15 Author: anoopsamjohn Authored: Mon Sep 26 11:11:52 2016 +0530 Committer: anoopsamjohn Committed: Mon Sep 26 11:11:52 2016 +0530 ---------------------------------------------------------------------- .../hadoop/hbase/filter/LongComparator.java | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/da37fd9c/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java ---------------------------------------------------------------------- diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java index 9c56772..6bd4b0f 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java @@ -20,8 +20,6 @@ package org.apache.hadoop.hbase.filter; import java.nio.ByteBuffer; -import com.google.protobuf.InvalidProtocolBufferException; - import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.exceptions.DeserializationException; @@ -29,30 +27,32 @@ import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.ByteBufferUtils; import org.apache.hadoop.hbase.util.Bytes; +import com.google.protobuf.InvalidProtocolBufferException; + /** * A long comparator which numerical compares against the specified byte array */ @InterfaceAudience.Public @InterfaceStability.Stable public class LongComparator extends ByteArrayComparable { - private Long longValue; + private long longValue; - public LongComparator(long value) { - super(Bytes.toBytes(value)); - this.longValue = value; - } + public LongComparator(long value) { + super(Bytes.toBytes(value)); + this.longValue = value; + } - @Override - public int compareTo(byte[] value, int offset, int length) { - Long that = Bytes.toLong(value, offset, length); - return this.longValue.compareTo(that); - } + @Override + public int compareTo(byte[] value, int offset, int length) { + long that = Bytes.toLong(value, offset, length); + return Long.compare(longValue, that); + } - @Override - public int compareTo(ByteBuffer value, int offset, int length) { - Long that = ByteBufferUtils.toLong(value, offset); - return this.longValue.compareTo(that); - } + @Override + public int compareTo(ByteBuffer value, int offset, int length) { + long that = ByteBufferUtils.toLong(value, offset); + return Long.compare(longValue, that); + } /** * @return The comparator serialized using pb