This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c28633  HBASE-26035 Redundant null check in the compareTo function 
(#3433)
1c28633 is described below

commit 1c28633fbae7f900453c80af5e5e1ecafe8221b5
Author: Almog Tavor <[email protected]>
AuthorDate: Thu Jul 1 17:56:14 2021 +0300

    HBASE-26035 Redundant null check in the compareTo function (#3433)
    
    Signed-off-by: Duo Zhang <[email protected]>
---
 .../apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
index 40df2ee..2f7f807 100644
--- 
a/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
+++ 
b/hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionSourceImpl.java
@@ -180,13 +180,7 @@ public class MetricsRegionSourceImpl implements 
MetricsRegionSource {
     if (!(source instanceof MetricsRegionSourceImpl)) {
       return -1;
     }
-
-    MetricsRegionSourceImpl impl = (MetricsRegionSourceImpl) source;
-    if (impl == null) {
-      return -1;
-    }
-
-    return Long.compare(hashCode, impl.hashCode);
+    return Long.compare(hashCode, ((MetricsRegionSourceImpl) source).hashCode);
   }
 
   void snapshot(MetricsRecordBuilder mrb, boolean ignored) {

Reply via email to