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

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

Issue 2529393002: Make core libraries use generic method syntax. (Closed)
Patch Set: Update status files. Created 3 years, 12 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 | « sdk/lib/core/iterable.dart ('k') | sdk/lib/internal/sort.dart » ('j') | 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 73b3669f5fc84facba92303c9b344cafd9a58313..637b0218a00c3ddcd2a8fedf642c00c6c8ede38e 100644
--- a/sdk/lib/internal/iterable.dart
+++ b/sdk/lib/internal/iterable.dart
@@ -172,8 +172,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
Iterable<E> where(bool test(E element)) => super.where(test);
- Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
- new MappedListIterable<E, dynamic/*=T*/ >(this, f);
+ Iterable<T> map<T>(T f(E element)) => new MappedListIterable<E, T>(this, f);
E reduce(E combine(var value, E element)) {
int length = this.length;
@@ -189,9 +188,7 @@ abstract class ListIterable<E> extends EfficientLengthIterable<E> {
return value;
}
- /*=T*/ fold/*<T>*/(
- var/*=T*/ initialValue, /*=T*/ combine(
- var/*=T*/ previousValue, E element)) {
+ T fold<T>(T initialValue, T combine(T previousValue, E element)) {
var value = initialValue;
int length = this.length;
for (int i = 0; i < length; i++) {
@@ -428,8 +425,7 @@ class WhereIterable<E> extends Iterable<E> {
Iterator<E> get iterator => new WhereIterator<E>(_iterable.iterator, _f);
// Specialization of [Iterable.map] to non-EfficientLengthIterable.
- Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
- new MappedIterable<E, dynamic/*=T*/>._(this, f);
+ Iterable<T> map<T>(T f(E element)) => new MappedIterable<E, T>._(this, f);
}
class WhereIterator<E> extends Iterator<E> {
@@ -720,15 +716,13 @@ class EmptyIterable<E> extends EfficientLengthIterable<E> {
Iterable<E> where(bool test(E element)) => this;
- Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) => const EmptyIterable();
+ Iterable<T> map<T>(T f(E element)) => const EmptyIterable();
E reduce(E combine(E value, E element)) {
throw IterableElementError.noElement();
}
- /*=T*/ fold/*<T>*/(
- var/*=T*/ initialValue, /*=T*/ combine(
- var/*=T*/ previousValue, E element)) {
+ T fold<T>(T initialValue, T combine(T previousValue, E element)) {
return initialValue;
}
« no previous file with comments | « sdk/lib/core/iterable.dart ('k') | sdk/lib/internal/sort.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698