adrian-bl/vanilla — pull request #71 by piemonkey (2014-02-18 00:07:12+00:00)
Title: Reimplement album shuffle so that output is more random

Removed the flawed Fisher-Yates shuffle and implemented a more (processor at least) efficient implementation involving Collection.shuffle() being called on an album list.

The old implementation picked an album to move by picking a random song in the sorted list then moving the corresponding album, this favours large albums and means that these are preferentially sorted first. Due to the difficulties in implementing a standard Fisher-Yates algorithm for items of variable length I opted to build a list of albums and sort this which increases efficiency by removing a large number of calls to arrayCopy.

I have a branch in my fork which contains some rudimentary tests to check randomness and performance but have not included those in the pull request as there is no precedent for unit testing in the code.

I believe this solves [issue #14](https://github.com/adrian-bl/vanilla/issues/14)