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

Unified Diff: sdk/lib/internal/iterable.dart

Issue 2354093002: Add WhereIterable.map (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/internal/iterable.dart
diff --git a/sdk/lib/internal/iterable.dart b/sdk/lib/internal/iterable.dart
index 2bedb48e64644e190efdf3dd1a650af2c097a524..0e7b171e26002c4aa73f57516a1b7246196dee82 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -426,6 +426,10 @@ class WhereIterable<E> extends Iterable<E> {
WhereIterable(this._iterable, bool this._f(E element));
Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, _f);
+
+ // Specialization of [Iterable.map] to non-EfficientLength.
+ Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
+ new MappedIterable<E, dynamic/*=T*/>._(this, f);
Lasse Reichstein Nielsen 2016/09/21 07:17:13 I don't see why this makes any difference - the me
sra1 2016/09/21 16:26:22 The difference is new MappedIterable<E, T>(this, f
Lasse Reichstein Nielsen 2016/09/21 19:42:16 Ah, I completely missed that difference :)
}
class WhereIterator<E> extends Iterator<E> {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698