mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Avoid reallocations with variadic arguments.
Thanks to huon for pointing that out.
This commit is contained in:
parent
78f368d336
commit
406acd17af
1 changed files with 1 additions and 1 deletions
|
@ -941,7 +941,7 @@ class CGArgumentConverter(CGThing):
|
|||
seqType = CGTemplatedType("Vec", declType)
|
||||
variadicConversion = string.Template(
|
||||
"{\n"
|
||||
" let mut vector: ${seqType} = vec![];\n"
|
||||
" let mut vector: ${seqType} = Vec::with_capacity((${argc} - ${index}) as uint);\n"
|
||||
" for variadicArg in range(${index}, ${argc}) {\n"
|
||||
"${inner}\n"
|
||||
" vector.push(slot);\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue