This looks wrong, an in-place sort needs random access and length.
@andralex