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

Unified Diff: frog/utils.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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: frog/utils.dart
===================================================================
--- frog/utils.dart (revision 2973)
+++ frog/utils.dart (working copy)
@@ -122,6 +122,9 @@
Iterator<E> iterator() => new FixedIterator<E>(value, length);
void forEach(void f(E element)) { Collections.forEach(this, f); }
+ Collection map(f(E element)) {
sra1 2012/01/05 22:46:49 nit: prefer =>, especially if it fits on one line.
+ return Collections.map(this, new List(), f);
+ }
Collection<E> filter(bool f(E element)) {
return Collections.filter(this, new List<E>(), f);
}

Powered by Google App Engine
This is Rietveld 408576698