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

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

Issue 2544163002: Fix runtime strong mode error in ListMixin (Closed)
Patch Set: Created 4 years 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: pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart b/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
index 37fdf0a366cf27dd98e80e22719218d2e0815806..f99944779c138c8c076e1f59af7af6b0ecb33fdb 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
+++ b/pkg/dev_compiler/tool/input_sdk/lib/collection/list.dart
@@ -267,17 +267,16 @@ abstract class ListMixin<E> implements List<E> {
}
void removeWhere(bool test(E element)) {
- _filter(this, test, false);
+ _filter(test, false);
}
void retainWhere(bool test(E element)) {
- _filter(this, test, true);
+ _filter(test, true);
}
- static void _filter(List source,
- bool test(var element),
- bool retainMatching) {
- List retained = [];
+ void _filter(bool test(var element), bool retainMatching) {
+ var source = this;
+ var retained = <E>[];
int length = source.length;
for (int i = 0; i < length; i++) {
var element = source[i];

Powered by Google App Engine
This is Rietveld 408576698