rm: improve is_dir_empty from O(n) to O(1)
#8384
Merged
is_dir_empty from O(n) to O(1)
#8384