Eliminate unnecessary sort.