Chromium Code Reviews| Index: sdk/lib/collection/list.dart |
| diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart |
| index b81b8dd7c11fc2180336f577443e4a92fe3b66d7..9c19c1e92baf2b91b44535a00a862f946e26f552 100644 |
| --- a/sdk/lib/collection/list.dart |
| +++ b/sdk/lib/collection/list.dart |
| @@ -274,10 +274,8 @@ abstract class ListMixin<E> implements List<E> { |
| _filter(this, test, true); |
| } |
| - static void _filter(List source, |
| - bool test(var element), |
| - bool retainMatching) { |
| - List retained = []; |
| + void _filter(List source, bool test(var element), bool retainMatching) { |
| + List<E> retained = <E>[]; |
|
Jennifer Messerly
2017/02/24 23:23:57
This change is needed to prevent a cast failure in
Lasse Reichstein Nielsen
2017/02/25 10:53:15
Acknowledged.
|
| int length = source.length; |
| for (int i = 0; i < length; i++) { |
| var element = source[i]; |
| @@ -309,7 +307,7 @@ abstract class ListMixin<E> implements List<E> { |
| void sort([int compare(E a, E b)]) { |
| if (compare == null) { |
| - Sort.sort(this, Comparable.compare); |
| + Sort.sort(this, (a, b) => Comparable.compare(a, b)); |
|
Jennifer Messerly
2017/02/24 23:23:57
This change is because Comparable.compare requires
Lasse Reichstein Nielsen
2017/02/25 10:53:15
Comparable.compare was always a type hack, so it's
Jennifer Messerly
2017/02/27 18:28:08
good catch, added _compareAny
|
| } else { |
| Sort.sort(this, compare); |
| } |