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

Unified Diff: sdk/lib/collection/list.dart

Issue 14048002: Make the analyzer happy about collections. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload. Created 7 years, 8 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/hash_set.dart ('k') | sdk/lib/collection/splay_tree.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 8c9dcd086dde71344cc7b55f95ec5f2ba805883e..dabbd966baf3c5e1015963121527c62235158531 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -292,7 +292,7 @@ abstract class ListMixin<E> implements List<E> {
}
- void retainAll(Iterable<E> iterable) {
+ void retainAll(Iterable<E> elements) {
if (elements is! Set) {
elements = elements.toSet();
}
@@ -327,8 +327,19 @@ abstract class ListMixin<E> implements List<E> {
}
}
+ void clear() { this.length = 0; }
+
// List interface.
+ E removeLast() {
+ if (length == 0) {
+ throw new StateError("No elements");
+ }
+ E result = this[length - 1];
+ length--;
+ return result;
+ }
+
void sort([Comparator<E> compare]) {
Sort.sort(this, compare);
}
@@ -440,8 +451,8 @@ abstract class ListMixin<E> implements List<E> {
if (startIndex < 0) {
return -1;
}
- if (startIndex >= a.length) {
- startIndex = a.length - 1;
+ if (startIndex >= this.length) {
+ startIndex = this.length - 1;
}
}
for (int i = startIndex; i >= 0; i--) {
« no previous file with comments | « sdk/lib/collection/hash_set.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698