From 215134feb530365a62fd78513be3c491a2a3b005 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Sat, 8 Dec 2007 01:21:14 +0000 Subject: [PATCH] Correct javadoc --- src/core/org/luaj/lib/TableLib.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/org/luaj/lib/TableLib.java b/src/core/org/luaj/lib/TableLib.java index 10d01f0c..08f522b4 100644 --- a/src/core/org/luaj/lib/TableLib.java +++ b/src/core/org/luaj/lib/TableLib.java @@ -121,12 +121,10 @@ public class TableLib extends LFunction { * * Get length of table t. */ - case INSERT: { - int n = vm.gettop(); + case GETN: { LTable table = vm.totable(2); - int pos = (n>=4? vm.tointeger(3): 0); - LValue value = vm.topointer(-1); - table.luaInsertPos( pos, value ); + vm.resettop(); + vm.pushinteger(table.luaLength()); 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 * 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); - vm.resettop(); - vm.pushinteger(table.luaLength()); + int pos = (n>=4? vm.tointeger(3): 0); + LValue value = vm.topointer(-1); + table.luaInsertPos( pos, value ); break; }