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

Unified Diff: runtime/vm/growable_array.h

Issue 1410493002: Complete support for Windows TLS destructors (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | runtime/vm/os_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | runtime/vm/os_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698