slight reduction in the number of comparisons for quicksort

This is only about a 1% reduction at best in the number of comparisons, because most comparisons are done in the leaves and the merge phase.  It just bugged me in #8840 that one if the `if` statements could be moved inside the other `if` statement.