DarkPhoenixs / hbase-meta-repair

Repair hbase metadata table from hdfs.
Apache License 2.0
41 stars 31 forks source link

Refactor:可以不用判断contains 直接进行remove #4

Closed limpidezza closed 10 months ago

limpidezza commented 3 years ago

有则remove

VictorZeng commented 2 years ago

从逻辑上是否进行contains是没有差别,不过从代码规范性上还是建议先进行存在性判断,还有从性能角度上面来看,如果对一个HashMap随机删除node的场景,先进行contains判断,存在则remove效率更好。