SIGN IN SIGN UP

playlist: improve shuffle algorithm

The old algorithm produced results which were not uniformly distributed,
i.e. some particular shuffles were preferred over others.

The new algorithm is an implementation of the Fisher-Yates shuffle which
is guaranteed to shuffle uniformly given a sufficiently uniform rand()
and ignoring potential floating-point errors.

Signed-off-by: wm4 <wm4@nowhere>
N
Niklas Haas committed
b9c48ca8f33e63549f51edb08bd50cc6cc8badbb
Parent: 3353923
Committed by wm4 <wm4@nowhere> on 3/20/2016, 6:51:22 PM