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

Unified Diff: dart/utils/pub/utils.dart

Issue 12296011: Version 0.3.7.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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 | « dart/utils/pub/entrypoint.dart ('k') | dart/utils/template/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/utils/pub/utils.dart
===================================================================
--- dart/utils/pub/utils.dart (revision 18634)
+++ dart/utils/pub/utils.dart (working copy)
@@ -274,13 +274,13 @@
/// Like [Iterable.where], but allows [test] to return [Future]s and uses the
/// results of those [Future]s as the test.
Future<Iterable> futureWhere(Iterable iter, test(value)) {
- return Future.wait(iter.mappedBy((e) {
+ return Future.wait(iter.map((e) {
var result = test(e);
if (result is! Future) result = new Future.immediate(result);
return result.then((result) => new Pair(e, result));
}))
.then((pairs) => pairs.where((pair) => pair.last))
- .then((pairs) => pairs.mappedBy((pair) => pair.first));
+ .then((pairs) => pairs.map((pair) => pair.first));
}
// TODO(nweiz): unify the following functions with the utility functions in
« no previous file with comments | « dart/utils/pub/entrypoint.dart ('k') | dart/utils/template/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698