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

Unified Diff: sdk/lib/collection/list.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/collection/iterable.dart ('k') | sdk/lib/collection/queue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/list.dart
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 8b6713aeb839bf99fc87ddeba90a52b0a8388c51..b81b8dd7c11fc2180336f577443e4a92fe3b66d7 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -175,11 +175,11 @@ abstract class ListMixin<E> implements List<E> {
Iterable<E> where(bool test(E element)) => new WhereIterable<E>(this, test);
- Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(E element)) =>
- new MappedListIterable/*<E, T>*/(this, f);
+ Iterable<T> map<T>(T f(E element)) =>
+ new MappedListIterable<E, T>(this, f);
- Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(E element)) =>
- new ExpandIterable<E, dynamic/*=T*/>(this, f);
+ Iterable<T> expand<T>(Iterable<T> f(E element)) =>
+ new ExpandIterable<E, T>(this, f);
E reduce(E combine(E previousValue, E element)) {
int length = this.length;
@@ -194,8 +194,8 @@ abstract class ListMixin<E> implements List<E> {
return value;
}
- dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
- dynamic/*=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++) {
@@ -371,7 +371,7 @@ abstract class ListMixin<E> implements List<E> {
List<E> otherList;
int otherStart;
// TODO(floitsch): Make this accept more.
- if (iterable is List/*<E>*/) {
+ if (iterable is List<E>) {
otherList = iterable;
otherStart = skipCount;
} else {
« no previous file with comments | « sdk/lib/collection/iterable.dart ('k') | sdk/lib/collection/queue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698