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

Unified Diff: src/runtime.cc

Issue 1712025: Use ScopedVector instead of dynamically allocated array. (Closed)
Patch Set: Created 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c35a1fb418e9338d121296f64910ff73afe82b76..0ac0641c37e0d0e96bc811094d14973528dc3cc6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -4225,7 +4225,7 @@ static Object* Runtime_GetLocalPropertyNames(Arguments args) {
int length = LocalPrototypeChainLength(*obj);
// Find the number of local properties for each of the objects.
- int* local_property_count = NewArray<int>(length);
+ ScopedVector<int> local_property_count(length);
int total_property_count = 0;
Handle<JSObject> jsproto = obj;
for (int i = 0; i < length; i++) {
@@ -4278,7 +4278,6 @@ static Object* Runtime_GetLocalPropertyNames(Arguments args) {
}
}
- DeleteArray(local_property_count);
return *Factory::NewJSArrayWithElements(names);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698