Make _compare_shortest_least a key function instead of a compare function.