Index: sdk/lib/collection/list.dart |
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart |
index 74cda1df9427ac81e091679df912bba3f770520a..eed6b32cefb5966d4803b52e881d8b85e1401697 100644 |
--- a/sdk/lib/collection/list.dart |
+++ b/sdk/lib/collection/list.dart |
@@ -301,8 +301,8 @@ abstract class ListMixin<E> implements List<E> { |
Sort.sort(this, compare); |
} |
- void shuffle() { |
- Random random = new Random(); |
+ void shuffle([Random random]) { |
+ if (random == null) random = new Random(); |
int length = this.length; |
while (length > 1) { |
int pos = random.nextInt(length); |