pre-allocate vararg table.

This commit is contained in:
James Roseborough
2009-01-29 17:58:34 +00:00
parent 47d6ac5cbf
commit be2cb77173

View File

@@ -181,7 +181,7 @@ public class LuaState extends Lua {
// add 'arg' compatibility variable
if ( (c.p.is_vararg & VARARG_NEEDSARG) != 0 ) {
LTable arg = new LTable();
LTable arg = new LTable(nvar,1);
for ( int i=1,j=base-nvar-1; i<=nvar; i++, j++ )
arg.put(i, stack[j]);
arg.put("n", nvar);