Index: sdk/lib/_collection_dev/iterable.dart |
diff --git a/sdk/lib/_collection_dev/iterable.dart b/sdk/lib/_collection_dev/iterable.dart |
index 5001fe38fe20cefba1d83a18e521d7404e5a38c4..3cc913baa37eae41ef30921970ba3b3805939ef4 100644 |
--- a/sdk/lib/_collection_dev/iterable.dart |
+++ b/sdk/lib/_collection_dev/iterable.dart |
@@ -958,8 +958,8 @@ class IterableMixinWorkaround { |
Sort.sort(list, compare); |
} |
- static void shuffleList(List list) { |
- Random random = new Random(); |
+ static void shuffleList(List list, Random random) { |
+ if (random == null) random = new Random(); |
int length = list.length; |
while (length > 1) { |
int pos = random.nextInt(length); |