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 @@
1/*1/*
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 $
3** Lua tables (hash)3** Lua tables (hash)
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -84,8 +84,8 @@ static const Node dummynode_ = { · 78 unmodified lines
84static Node *hashnum (const Table *t, lua_Number n) {84static 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]);

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