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

Unified Diff: pkg/third_party/html5lib/lib/src/list_proxy.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
Index: pkg/third_party/html5lib/lib/src/list_proxy.dart
diff --git a/pkg/third_party/html5lib/lib/src/list_proxy.dart b/pkg/third_party/html5lib/lib/src/list_proxy.dart
index 786e39373a99b82b7f42600bfc847a5ae4375faf..d779043cdf6b9786773117ac50f9814916ded4ba 100644
--- a/pkg/third_party/html5lib/lib/src/list_proxy.dart
+++ b/pkg/third_party/html5lib/lib/src/list_proxy.dart
@@ -5,6 +5,7 @@
library list_proxy;
import 'dart:collection';
+import 'dart:math' show Random;
// TOOD(jmesserly): this needs to be removed, but fixing NodeList is tricky.
class ListProxy<E> extends IterableBase<E> implements List<E> {
@@ -51,7 +52,7 @@ class ListProxy<E> extends IterableBase<E> implements List<E> {
void addLast(E value) { add(value); }
void addAll(Iterable<E> collection) { _list.addAll(collection); }
void sort([int compare(E a, E b)]) { _list.sort(compare); }
- void shuffle() { _list.shuffle(); }
+ void shuffle([Random random]) { _list.shuffle(random); }
int indexOf(E element, [int start = 0]) => _list.indexOf(element, start);
int lastIndexOf(E element, [int start]) => _list.lastIndexOf(element, start);

Powered by Google App Engine
This is Rietveld 408576698