HBASE-26035 Redundant null check in the compareTo function (#3433)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
Almog Tavor 2021-07-01 17:56:14 +03:00 committed by Duo Zhang
parent fe6c75cb50
commit ee7f15a675
1 changed files with 1 additions and 7 deletions

View File

@ -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) {