HDFS-13829. Remove redundant condition judgement in DirectoryScanner#scan. Contributed by liaoyuxiangqin.

This commit is contained in:
Yiqun Lin 2018-08-16 18:44:18 +08:00
parent 7dc79a8b5b
commit 6df606f1b4

View File

@ -450,7 +450,7 @@ private void scan() {
if (d < blockpoolReport.length) { if (d < blockpoolReport.length) {
// There may be multiple on-disk records for the same block, don't increment // There may be multiple on-disk records for the same block, don't increment
// the memory record pointer if so. // the memory record pointer if so.
ScanInfo nextInfo = blockpoolReport[Math.min(d, blockpoolReport.length - 1)]; ScanInfo nextInfo = blockpoolReport[d];
if (nextInfo.getBlockId() != info.getBlockId()) { if (nextInfo.getBlockId() != info.getBlockId()) {
++m; ++m;
} }