aboutsummaryrefslogtreecommitdiff
path: root/lbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbuiltin.c')
-rw-r--r--lbuiltin.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index b7365f66..74e8c6d0 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.61 1999/08/16 20:52:00 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.62 1999/09/08 20:45:18 roberto Exp roberto $
3** Built-in functions 3** Built-in functions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -44,13 +44,14 @@ static void pushtagstring (TaggedString *s) {
44 44
45static real getsize (const Hash *h) { 45static real getsize (const Hash *h) {
46 real max = 0; 46 real max = 0;
47 int i; 47 int i = nhash(h);
48 for (i = 0; i<nhash(h); i++) { 48 Node *n = h->node;
49 Node *n = h->node+i; 49 while (i--) {
50 if (ttype(ref(n)) == LUA_T_NUMBER && 50 if (ttype(ref(n)) == LUA_T_NUMBER &&
51 ttype(val(n)) != LUA_T_NIL && 51 ttype(val(n)) != LUA_T_NIL &&
52 nvalue(ref(n)) > max) 52 nvalue(ref(n)) > max)
53 max = nvalue(ref(n)); 53 max = nvalue(ref(n));
54 n++;
54 } 55 }
55 return max; 56 return max;
56} 57}
@@ -677,9 +678,6 @@ static void testC (void) {
677 678
678 679
679static const struct luaL_reg builtin_funcs[] = { 680static const struct luaL_reg builtin_funcs[] = {
680#ifdef LUA_COMPAT2_5
681 {"setfallback", luaT_setfallback},
682#endif
683#ifdef DEBUG 681#ifdef DEBUG
684 {"testC", testC}, 682 {"testC", testC},
685 {"totalmem", mem_query}, 683 {"totalmem", mem_query},