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 GitHub
parent 84f9900c99
commit 1c28633fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {