[Subversion] Get rid of O(n) reverse.

Pack it into the sorting algorithm itself. Now O(nlogn).