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

Unified Diff: tool/input_sdk/lib/collection/list.dart

Issue 1956933002: Update collection (list / map / iterable) printing. (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 7 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 | « tool/input_sdk/lib/collection/linked_hash_set.dart ('k') | tool/input_sdk/lib/collection/maps.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/lib/collection/list.dart
diff --git a/tool/input_sdk/lib/collection/list.dart b/tool/input_sdk/lib/collection/list.dart
index ac1be05af0fa511cd1e45d92d084d61b0cf4dd19..7e6dbd3adc18306ba52249a85ea852921eec7a17 100644
--- a/tool/input_sdk/lib/collection/list.dart
+++ b/tool/input_sdk/lib/collection/list.dart
@@ -175,7 +175,8 @@ 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, dynamic/*=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);
@@ -193,7 +194,8 @@ abstract class ListMixin<E> implements List<E> {
return value;
}
- /*=T*/ fold/*<T>*/(var/*=T*/ initialValue, /*=T*/combine(var/*=T*/ previousValue, E element)) {
+ dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
+ dynamic/*=T*/ combine(var/*=T*/ previousValue, E element)) {
var value = initialValue;
int length = this.length;
for (int i = 0; i < length; i++) {
@@ -306,7 +308,11 @@ abstract class ListMixin<E> implements List<E> {
}
void sort([int compare(E a, E b)]) {
- Sort.sort(this, compare == null ? Comparable.compare : compare);
+ if (compare == null) {
+ Sort.sort(this, Comparable.compare);
+ } else {
+ Sort.sort(this, compare);
+ }
}
void shuffle([Random random]) {
@@ -362,10 +368,10 @@ abstract class ListMixin<E> implements List<E> {
if (length == 0) return;
RangeError.checkNotNegative(skipCount, "skipCount");
- List otherList;
+ List<E> otherList;
int otherStart;
// TODO(floitsch): Make this accept more.
- if (iterable is List) {
+ if (iterable is List/*<E>*/) {
otherList = iterable;
otherStart = skipCount;
} else {
« no previous file with comments | « tool/input_sdk/lib/collection/linked_hash_set.dart ('k') | tool/input_sdk/lib/collection/maps.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698