formating code

This commit is contained in:
Pawel Kolodziejski
2008-09-10 11:16:57 +00:00
parent 0dd0b73b2a
commit 94dbb1a1da
19 changed files with 54 additions and 58 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ static int32 newsize(stringtable *tb) {
// count how many entries are really in use
for (i = 0; i < size; i++)
if (tb->hash[i] != NULL && tb->hash[i] != &EMPTY)
if (tb->hash[i] && tb->hash[i] != &EMPTY)
realuse++;
if (2 * (realuse + 1) <= size) // +1 is the new element
return size; // don't need to grow, just rehash to clear EMPTYs
@@ -59,7 +59,7 @@ static void grow(stringtable *tb) {
// rehash
tb->nuse = 0;
for (i = 0; i < tb->size; i++) {
if (tb->hash[i] != NULL && tb->hash[i] != &EMPTY) {
if (tb->hash[i] && tb->hash[i] != &EMPTY) {
int32 h = tb->hash[i]->hash % ns;
while (newhash[h])
h = (h + 1) % ns;