Sort the invert table.

sort with std::sort of <algorithm>.