Remove one unnecessary loop iteration from selection sort