Correct javadoc

This commit is contained in:
James Roseborough
2007-12-08 01:21:14 +00:00
parent 0f3fe0452d
commit 215134feb5

View File

@@ -121,12 +121,10 @@ public class TableLib extends LFunction {
* *
* Get length of table t. * Get length of table t.
*/ */
case INSERT: { case GETN: {
int n = vm.gettop();
LTable table = vm.totable(2); LTable table = vm.totable(2);
int pos = (n>=4? vm.tointeger(3): 0); vm.resettop();
LValue value = vm.topointer(-1); vm.pushinteger(table.luaLength());
table.luaInsertPos( pos, value );
break; break;
} }
@@ -136,10 +134,12 @@ public class TableLib extends LFunction {
* The default value for pos is n+1, where n is the length of the table (see §2.5.5), so that a call * The default value for pos is n+1, where n is the length of the table (see §2.5.5), so that a call
* table.insert(t,x) inserts x at the end of table t. * table.insert(t,x) inserts x at the end of table t.
*/ */
case GETN: { case INSERT: {
int n = vm.gettop();
LTable table = vm.totable(2); LTable table = vm.totable(2);
vm.resettop(); int pos = (n>=4? vm.tointeger(3): 0);
vm.pushinteger(table.luaLength()); LValue value = vm.topointer(-1);
table.luaInsertPos( pos, value );
break; break;
} }