diff options
-rw-r--r-- | ltable.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.35 2006/09/11 14:07:24 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.36 2007/04/10 12:18:17 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -84,8 +84,8 @@ static const Node dummynode_ = { | |||
84 | static Node *hashnum (const Table *t, lua_Number n) { | 84 | static Node *hashnum (const Table *t, lua_Number n) { |
85 | unsigned int a[numints]; | 85 | unsigned int a[numints]; |
86 | int i; | 86 | int i; |
87 | n += 1; /* normalize number (avoid -0) */ | 87 | if (luai_numeq(n, 0)) /* avoid problems with -0 */ |
88 | lua_assert(sizeof(a) <= sizeof(n)); | 88 | return gnode(t, 0); |
89 | memcpy(a, &n, sizeof(a)); | 89 | memcpy(a, &n, sizeof(a)); |
90 | for (i = 1; i < numints; i++) a[0] += a[i]; | 90 | for (i = 1; i < numints; i++) a[0] += a[i]; |
91 | return hashmod(t, a[0]); | 91 | return hashmod(t, a[0]); |