Skip to content

Commit

Permalink
HDFS-14799. Do Not Call Map containsKey In Conjunction with get. Cont…
Browse files Browse the repository at this point in the history
…ributed by hemanthboyina.
  • Loading branch information
ayushtkn committed Sep 14, 2019
1 parent 9a931b8 commit e04b8a4
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,11 @@ long getECBlocks() {
}

private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn) {
if (nodeToBlocks.containsKey(dn)) {
return nodeToBlocks.get(dn);
}
return null;
return nodeToBlocks.get(dn);
}

private LightWeightHashSet<Block> getECBlocksSet(final DatanodeInfo dn) {
if (nodeToECBlocks.containsKey(dn)) {
return nodeToECBlocks.get(dn);
}
return null;
return nodeToECBlocks.get(dn);
}

private LightWeightHashSet<Block> getBlocksSet(final DatanodeInfo dn,
Expand Down

0 comments on commit e04b8a4

Please sign in to comment.