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

Unified Diff: runtime/lib/growable_array.dart

Issue 11931034: Add methods to Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also on DoubleLinkedQueue. Created 7 years, 11 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
Index: runtime/lib/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index 0b384a8c54b8da0c3dec39f4085b2202f9a6d9dd..ea0f7bcb3be202a31124513ffaa3feadec5b690f 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -21,6 +21,21 @@ class _GrowableObjectArray<T> implements List<T> {
return result;
}
+ void remove(Object element) {
+ for (int i = 0; i < this.length; i++) {
+ if (this[i] == element) {
+ int newLength = this.length - 1;
+ Arrays.copy(this,
+ index + 1,
+ this,
+ index,
+ newLength - index);
+ this.length = newLength;
+ return;
+ }
+ }
+ }
+
void setRange(int start, int length, List<T> from, [int startFrom = 0]) {
if (length < 0) {
throw new ArgumentError("negative length $length");

Powered by Google App Engine
This is Rietveld 408576698