浏览代码

'table.pack' does not return 'n' (may be confusing when
using table.pack as last argument in a call)

Roberto Ierusalimschy 13 年之前
父节点
当前提交
ece042fef0
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      ltablib.c

+ 2 - 3
ltablib.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: ltablib.c,v 1.61 2011/07/05 12:49:35 roberto Exp roberto $
+** $Id: ltablib.c,v 1.62 2011/09/30 12:45:45 roberto Exp roberto $
 ** Library for Table Manipulation
 ** Library for Table Manipulation
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -129,8 +129,7 @@ static int pack (lua_State *L) {
     for (i = n; i >= 2; i--)  /* assign other elements */
     for (i = n; i >= 2; i--)  /* assign other elements */
       lua_rawseti(L, 1, i);
       lua_rawseti(L, 1, i);
   }
   }
-  lua_pushinteger(L, n);
-  return 2;  /* return table and number of elements */
+  return 1;  /* return table */
 }
 }