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

Unified Diff: packages/quiver/lib/src/iterables/enumerate.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
Index: packages/quiver/lib/src/iterables/enumerate.dart
diff --git a/packages/quiver/lib/src/iterables/enumerate.dart b/packages/quiver/lib/src/iterables/enumerate.dart
index 72a02a944a4e79c93877ae14bfb038cff53928ca..2d940b88172cf4b7792fd5a04b4269b5da9d1b80 100644
--- a/packages/quiver/lib/src/iterables/enumerate.dart
+++ b/packages/quiver/lib/src/iterables/enumerate.dart
@@ -14,12 +14,10 @@
part of quiver.iterables;
-/**
- * Returns an [Iterable] of [IndexedValue]s where the nth value holds the nth
- * element of [iterable] and its index.
- */
-Iterable<IndexedValue> enumerate(Iterable iterable) =>
- new EnumerateIterable(iterable);
+/// Returns an [Iterable] of [IndexedValue]s where the nth value holds the nth
+/// element of [iterable] and its index.
+Iterable<IndexedValue<E>>
+ enumerate<E>(Iterable<E> iterable) => new EnumerateIterable<E>(iterable);
class IndexedValue<V> {
final int index;
@@ -32,10 +30,8 @@ class IndexedValue<V> {
String toString() => '($index, $value)';
}
-/**
- * An [Iterable] of [IndexedValue]s where the nth value holds the nth
- * element of [iterable] and its index. See [enumerate].
- */
+/// An [Iterable] of [IndexedValue]s where the nth value holds the nth
+/// element of [iterable] and its index. See [enumerate].
// This was inspired by MappedIterable internal to Dart collections.
class EnumerateIterable<V> extends IterableBase<IndexedValue<V>> {
final Iterable<V> _iterable;
@@ -57,7 +53,7 @@ class EnumerateIterable<V> extends IterableBase<IndexedValue<V>> {
new IndexedValue<V>(index, _iterable.elementAt(index));
}
-/** The [Iterator] returned by [EnumerateIterable.iterator]. */
+/// The [Iterator] returned by [EnumerateIterable.iterator].
class EnumerateIterator<V> extends Iterator<IndexedValue<V>> {
final Iterator<V> _iterator;
int _index = 0;
« no previous file with comments | « packages/quiver/lib/src/iterables/cycle.dart ('k') | packages/quiver/lib/src/iterables/generating_iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698