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

Unified Diff: runtime/lib/array.dart

Issue 11727007: Add min and max to Iterable and Stream. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Created 7 years, 12 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 | « no previous file | runtime/lib/byte_array.dart » ('j') | runtime/lib/byte_array.dart » ('J')
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 fd42a675c083112662266f788f4504518d1b411d..4fa5b145f464bdb262d6ec1aa9a516429a4f9a04 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -192,6 +192,10 @@ class _ObjectArray<E> implements List<E> {
throw new StateError("More than one element");
}
+ E min([int compare(E a, E b)]) => Collections.min(this, compare);
+
+ E max([int compare(E a, E b)]) => Collections.max(this, compare);
+
List<E> toList() {
return new List<E>.from(this);
}
« no previous file with comments | « no previous file | runtime/lib/byte_array.dart » ('j') | runtime/lib/byte_array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698