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

Unified Diff: sdk/lib/html/templates/immutable_list_mixin.darttemplate

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
Index: sdk/lib/html/templates/immutable_list_mixin.darttemplate
diff --git a/sdk/lib/html/templates/immutable_list_mixin.darttemplate b/sdk/lib/html/templates/immutable_list_mixin.darttemplate
index 926490847c4a268c78c0445d6147ae92293d4de0..f94ba1ca29fb4df2cc2fd3c216fe8ca8a4659eb3 100644
--- a/sdk/lib/html/templates/immutable_list_mixin.darttemplate
+++ b/sdk/lib/html/templates/immutable_list_mixin.darttemplate
@@ -123,6 +123,10 @@ $endif
throw new StateError("More than one element");
}
+ $E min([int compare($E a, $E b)]) => _Collections.minInList(this, compare);
+
+ $E max([int compare($E a, $E b)]) => _Collections.maxInList(this, compare);
+
$E removeAt(int pos) {
throw new UnsupportedError("Cannot removeAt on immutable List.");
}

Powered by Google App Engine
This is Rietveld 408576698