Commits
Click on a commit to change the comparison rangeshuf: correctness: Use Fisher-Yates for nonrepeating integers
We used to use a clever homegrown way to sample integers. But GNU shuf
with --random-source observably uses Fisher-Yates, and the output of
the old version depended on a heuristic (making it dangerous for
--random-seed).
So now we do Fisher-Yates here, just like we do for other inputs. In
deterministic modes the output for --input-range is identical that for
piping `seq` into `shuf`.
We imitate the old algorithm's method for keeping the resource use in
check. The performance of the new version is very close to that of the
old version: I haven't found any cases where it's much faster or much
slower. Merge branch 'main' into clean-shuf-2