[distance] eliminate more useless code in segment-box computation