Index: Source/bindings/v8/V8Binding.h |
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h |
index f15a1bc7ba703627b1f53c30a62fe8fa7f2ac359..cbcf7b50a3f05822d395aad7e0f32705e455ff8c 100644 |
--- a/Source/bindings/v8/V8Binding.h |
+++ b/Source/bindings/v8/V8Binding.h |
@@ -435,13 +435,14 @@ namespace WebCore { |
return Vector<RefPtr<T> >(); |
Vector<RefPtr<T> > result; |
+ result.reserveInitialCapacity(length); |
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); |
for (uint32_t i = 0; i < length; ++i) { |
v8::Handle<v8::Value> element = object->Get(i); |
if (V8T::HasInstance(element, isolate, worldType(isolate))) { |
v8::Handle<v8::Object> elementObject = v8::Handle<v8::Object>::Cast(element); |
- result.append(V8T::toNative(elementObject)); |
+ result.uncheckedAppend(V8T::toNative(elementObject)); |
} else { |
if (success) |
*success = false; |
@@ -465,10 +466,11 @@ namespace WebCore { |
return Vector<T>(); |
Vector<T> result; |
+ result.reserveInitialCapacity(length); |
typedef NativeValueTraits<T> TraitsType; |
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); |
for (uint32_t i = 0; i < length; ++i) |
- result.append(TraitsType::nativeValue(object->Get(i))); |
+ result.uncheckedAppend(TraitsType::nativeValue(object->Get(i))); |
return result; |
} |
@@ -479,8 +481,9 @@ namespace WebCore { |
Vector<T> result; |
typedef NativeValueTraits<T> TraitsType; |
int length = args.Length(); |
+ result.reserveInitialCapacity(length); |
for (int i = startIndex; i < length; ++i) |
- result.append(TraitsType::nativeValue(args[i])); |
+ result.uncheckedAppend(TraitsType::nativeValue(args[i])); |
return result; |
} |