Do not reallocate the full sort arrays every time we sort.
Fixes #570 (closed) by reverting to the old behaviour.
Improved solutions can be tested later.
Fixes #570 (closed) by reverting to the old behaviour.
Improved solutions can be tested later.