summaryrefslogtreecommitdiff
path: root/lib/lua/src/ltable.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lua/src/ltable.c')
-rw-r--r--lib/lua/src/ltable.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/lua/src/ltable.c b/lib/lua/src/ltable.c
index 62d757a..f9145ed 100644
--- a/lib/lua/src/ltable.c
+++ b/lib/lua/src/ltable.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltable.c,v 1.5 2007-07-27 10:05:54 pixel Exp $
+** $Id: ltable.c,v 1.6 2008-02-17 00:35:20 pixel Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/
@@ -84,8 +84,8 @@ static const Node dummynode_ = {
static Node *hashnum (const Table *t, lua_Number n) {
unsigned int a[numints];
int i;
- n += 1; /* normalize number (avoid -0) */
- lua_assert(sizeof(a) <= sizeof(n));
+ if (luai_numeq(n, 0)) /* avoid problems with -0 */
+ return gnode(t, 0);
memcpy(a, &n, sizeof(a));
for (i = 1; i < numints; i++) a[0] += a[i];
return hashmod(t, a[0]);