Index: runtime/vm/growable_array.h |
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h |
index 9023948c605d500229b97a8f59ed45bc9e805741..42b787be634d78b6904ddadfdc9e55d2c9e326b4 100644 |
--- a/runtime/vm/growable_array.h |
+++ b/runtime/vm/growable_array.h |
@@ -110,6 +110,17 @@ class BaseGrowableArray : public B { |
data_[j] = temp; |
} |
+ // NOTE: Does not preserve array order. |
+ void RemoveAt(intptr_t i) { |
+ ASSERT(i >= 0); |
+ ASSERT(i < length_); |
+ intptr_t last = length_ - 1; |
+ if (i < last) { |
+ Swap(i, last); |
+ } |
+ RemoveLast(); |
+ } |
+ |
// The content is uninitialized after calling it. |
void SetLength(intptr_t new_length); |