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

Unified Diff: packages/quiver_iterables/lib/src/count.dart

Issue 2119523002: Added full js & js_util packages (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 4 years, 6 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/quiver_iterables/lib/src/concat.dart ('k') | packages/quiver_iterables/lib/src/cycle.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/quiver_iterables/lib/src/count.dart
diff --git a/packages/quiver/lib/src/iterables/concat.dart b/packages/quiver_iterables/lib/src/count.dart
similarity index 74%
copy from packages/quiver/lib/src/iterables/concat.dart
copy to packages/quiver_iterables/lib/src/count.dart
index b4ab751adb549fe9debce9535a0f780233f14472..093423a08043f53c89514045fe32a1ccee63f360 100644
--- a/packages/quiver/lib/src/iterables/concat.dart
+++ b/packages/quiver_iterables/lib/src/count.dart
@@ -14,9 +14,11 @@
part of quiver.iterables;
-/**
- * Returns the concatentation of the input iterables.
- *
- * The returned iterable is a lazily-evaluated view on the input iterables.
- */
-Iterable concat(Iterable<Iterable> iterables) => iterables.expand((x) => x);
+/// Returns an infinite [Iterable] of [num]s, starting from [start] and
+/// increasing by [step].
+Iterable<num> count([num start = 0, num step = 1]) sync* {
+ while (true) {
+ yield start;
+ start += step;
+ }
+}
« no previous file with comments | « packages/quiver_iterables/lib/src/concat.dart ('k') | packages/quiver_iterables/lib/src/cycle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698