diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-08-27 15:28:54 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-08-27 15:28:54 -0700 |
commit | 46178c0fb9a8fb25479d27f4653dc9123bdd8791 (patch) | |
tree | 8f9700b8712cf0c12875e62a0218945ab77585b8 /src | |
parent | 442e2f2f66271edd1b28e26c5fac8ecc09b73d30 (diff) | |
download | dsub-46178c0fb9a8fb25479d27f4653dc9123bdd8791.tar.gz dsub-46178c0fb9a8fb25479d27f4653dc9123bdd8791.tar.bz2 dsub-46178c0fb9a8fb25479d27f4653dc9123bdd8791.zip |
#385 Improve randomness by keeping a static random generator
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/OfflineMusicService.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/OfflineMusicService.java b/src/github/daneren2005/dsub/service/OfflineMusicService.java index 8aeba2b4..788057d2 100644 --- a/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -66,6 +66,7 @@ import java.util.SortedSet; public class OfflineMusicService implements MusicService { private static final String TAG = OfflineMusicService.class.getSimpleName(); private static final String ERRORMSG = "Not available in offline mode"; + private static final Random random = new Random(); @Override public void ping(Context context, ProgressListener progressListener) throws Exception { @@ -668,7 +669,6 @@ public class OfflineMusicService implements MusicService { if (children.isEmpty()) { return result; } - Random random = new Random(); for (int i = 0; i < size; i++) { File file = children.get(random.nextInt(children.size())); result.addChild(createEntry(context, file, getName(file))); |