Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: runtime/lib/array.dart

Issue 25931003: Make List.shuffle take an optional Random object to use. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/unmodifiable_collection/lib/unmodifiable_collection.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index fe9a15b9f61a2a2f1146bc82531ce2c8bf5b8c8a..a953f71ea3f1fd6c675a2c3ca7c7a4f16ba618e4 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -202,8 +202,8 @@ class _List<E> implements List<E> {
IterableMixinWorkaround.sortList(this, compare);
}
- void shuffle() {
- IterableMixinWorkaround.shuffleList(this);
+ void shuffle([Random random]) {
+ IterableMixinWorkaround.shuffleList(this, random);
}
int indexOf(Object element, [int start = 0]) {
@@ -460,7 +460,7 @@ class _ImmutableList<E> implements List<E> {
"Cannot modify an immutable array");
}
- void shuffle() {
+ void shuffle([Random random]) {
throw new UnsupportedError(
"Cannot modify an immutable array");
}
« no previous file with comments | « pkg/unmodifiable_collection/lib/unmodifiable_collection.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698