Index: runtime/vm/growable_array.h |
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h |
index 2a7fd98be540b81d4a65c51d446fb5376cb47e66..9c472e78f97aabf065df28d0573a129f1f353bd6 100644 |
--- a/runtime/vm/growable_array.h |
+++ b/runtime/vm/growable_array.h |
@@ -36,6 +36,11 @@ class BaseGrowableArray : public B { |
T* data() const { return data_; } |
bool is_empty() const { return length_ == 0; } |
+ void TruncateTo(intptr_t length) { |
+ ASSERT(length_ >= length); |
+ length_ = length; |
+ } |
+ |
void Add(const T& value) { |
Resize(length() + 1); |
Last() = value; |