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

Unified Diff: runtime/lib/byte_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: Address review comments. Fix T->E in Iterable. 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: runtime/lib/byte_array.dart
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index 724d92f524b0e5f2f9e56d49e40bd17b85acb6fc..f1358ce5f06b5014f9b8345c6fc1ec81ada6245c 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -323,6 +323,10 @@ abstract class _ByteArrayBase {
throw new StateError("More than one element");
}
+ int min([int compare(int a, int b)]) => Collections.min(this, compare);
+
+ int max([int compare(int a, int b)]) => Collections.max(this, compare);
+
void removeRange(int start, int length) {
throw new UnsupportedError(
"Cannot remove from a non-extendable array");

Powered by Google App Engine
This is Rietveld 408576698