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

Unified Diff: packages/which/lib/src/util.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/which/lib/src/is_executable.dart ('k') | packages/which/lib/src/which_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/which/lib/src/util.dart
diff --git a/packages/which/lib/src/util.dart b/packages/which/lib/src/util.dart
deleted file mode 100755
index 41af1393d2a827c7dab6edcab17c15fabdf92636..0000000000000000000000000000000000000000
--- a/packages/which/lib/src/util.dart
+++ /dev/null
@@ -1,18 +0,0 @@
-
-library which.src.util;
-
-import 'dart:async';
-
-/// Transparently call `firstWhere` on a [Stream] or [Iterable].
-// TODO: Remove once https://dartbug.com/ is fixed.
-firstWhere(sequence, test, { orElse() }) => sequence is Iterable ?
- sequence.firstWhere(test, orElse: orElse) :
- _streamFirstWhere(sequence, test, orElse: orElse);
-
-Future _streamFirstWhere(Stream stream, test(item), { orElse() }) {
- var pairs = stream.asyncMap((item) => test(item).then((result) => [item, result]));
- return pairs.firstWhere((pair) => pair.last, defaultValue: () => [orElse(), null]).then((pair) => pair.first);
-}
-
-/// The identity function simply returns its argument ([x]).
-identity(x) => x;
« no previous file with comments | « packages/which/lib/src/is_executable.dart ('k') | packages/which/lib/src/which_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698