Revert "fix bug 974544 - remove additional unneseccary sorted function after _do_sort has already sorted."

This reverts commit 0960ddc1d4d176cc30f0286029323e73ba557d40.