sorting: speed up sort-keys and sort-values by doing less bounds checking.