Skip to content

Commit

Permalink
HBASE-26035 Redundant null check in the compareTo function (#3433)
Browse files Browse the repository at this point in the history
Signed-off-by: Duo Zhang <[email protected]>
  • Loading branch information
almogtavor authored and Apache9 committed Jul 1, 2021
1 parent 9c7d9fa commit 0acf4e1
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,7 @@ public int compareTo(MetricsRegionSource source) {
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) {
Expand Down

0 comments on commit 0acf4e1

Please sign in to comment.