Bug 637905 - Add (asserted-infallible) append methods to js::Vector, for use when the vector in question has previously had space reserved, and use them a bunch of places. r=luke
This commit is contained in:
@@ -3257,7 +3257,7 @@ js_CloneDensePrimitiveArray(JSContext *cx, JSObject *obj, JSObject **clone)
|
||||
*/
|
||||
jsuint jsvalCount = JS_MIN(obj->getDenseArrayCapacity(), length);
|
||||
|
||||
js::AutoValueVector vector(cx);
|
||||
AutoValueVector vector(cx);
|
||||
if (!vector.reserve(jsvalCount))
|
||||
return JS_FALSE;
|
||||
|
||||
@@ -3277,7 +3277,7 @@ js_CloneDensePrimitiveArray(JSContext *cx, JSObject *obj, JSObject **clone)
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
vector.append(val);
|
||||
vector.infallibleAppend(val);
|
||||
}
|
||||
|
||||
*clone = NewDenseCopiedArray(cx, jsvalCount, vector.begin());
|
||||
|
||||
Reference in New Issue
Block a user