diff options
Diffstat (limited to 'ltable.c')
| -rw-r--r-- | ltable.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltable.c,v 1.48 2000/06/12 13:52:05 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 1.49 2000/06/28 17:03:56 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 | */ |
| @@ -63,7 +63,7 @@ Node *luaH_mainposition (const Hash *t, const TObject *key) { | |||
| 63 | default: | 63 | default: |
| 64 | return NULL; /* invalid key */ | 64 | return NULL; /* invalid key */ |
| 65 | } | 65 | } |
| 66 | LUA_ASSERT(L, h%(unsigned int)t->size == (h&((unsigned int)t->size-1)), | 66 | LUA_ASSERT(h%(unsigned int)t->size == (h&((unsigned int)t->size-1)), |
| 67 | "a&(x-1) == a%x, for x power of 2"); | 67 | "a&(x-1) == a%x, for x power of 2"); |
| 68 | return &t->node[h&(t->size-1)]; | 68 | return &t->node[h&(t->size-1)]; |
| 69 | } | 69 | } |
| @@ -140,7 +140,7 @@ void luaH_remove (Hash *t, TObject *key) { | |||
| 140 | } | 140 | } |
| 141 | ttype(key) = TAG_NUMBER; | 141 | ttype(key) = TAG_NUMBER; |
| 142 | nvalue(key) = n; | 142 | nvalue(key) = n; |
| 143 | LUA_ASSERT(L, luaH_mainposition(t, key) == mp, "cannot change hash"); | 143 | LUA_ASSERT(luaH_mainposition(t, key) == mp, "cannot change hash"); |
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 | ||
| @@ -196,7 +196,7 @@ static void rehash (lua_State *L, Hash *t) { | |||
| 196 | Node *nold = t->node; | 196 | Node *nold = t->node; |
| 197 | int nelems = numuse(t); | 197 | int nelems = numuse(t); |
| 198 | int i; | 198 | int i; |
| 199 | LUA_ASSERT(L, nelems<=oldsize, "wrong count"); | 199 | LUA_ASSERT(nelems<=oldsize, "wrong count"); |
| 200 | if (nelems >= oldsize-oldsize/4) /* using more than 3/4? */ | 200 | if (nelems >= oldsize-oldsize/4) /* using more than 3/4? */ |
| 201 | setnodevector(L, t, (lint32)oldsize*2); | 201 | setnodevector(L, t, (lint32)oldsize*2); |
| 202 | else if (nelems <= oldsize/4 && /* less than 1/4? */ | 202 | else if (nelems <= oldsize/4 && /* less than 1/4? */ |
