History

Lua 5.1.3-rc1

Lua Team committed 18 years ago

Commit ea97e791 parent 4d388a360 files · +732 −439Browse files

Showing the changes to src/ltable.c (1 of 60 files). Show all

Unified · Split

src/ltable.c+3−3
@@ -1,5 +1,5 @@
11 /*
2−** $Id: ltable.c,v 2.32 2006/01/18 11:49:02 roberto Exp $
2+** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $
33 ** Lua tables (hash)
44 ** See Copyright Notice in lua.h
55 */
@@ -84,8 +84,8 @@ static const Node dummynode_ = { · 78 unmodified lines
8484 static Node *hashnum (const Table *t, lua_Number n) {
8585 unsigned int a[numints];
8686 int i;
87− n += 1; /* normalize number (avoid -0) */
88− lua_assert(sizeof(a) <= sizeof(n));
87+ if (luai_numeq(n, 0)) /* avoid problems with -0 */
88+ return gnode(t, 0);
8989 memcpy(a, &n, sizeof(a));
9090 for (i = 1; i < numints; i++) a[0] += a[i];
9191 return hashmod(t, a[0]);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t