Minor cleanup.
This commit is contained in:
parent
be214ce2b5
commit
c8360c7f7a
|
|
@ -315,10 +315,10 @@ ht_insert(char *symbol)
|
||||||
char*
|
char*
|
||||||
ht_lookup(u32 hash)
|
ht_lookup(u32 hash)
|
||||||
{
|
{
|
||||||
|
// Note that hash must be truncated to N (N=30 as it happens) bits
|
||||||
|
// by VALUE_OF().
|
||||||
u32 index = hash % CAPACITY;
|
u32 index = hash % CAPACITY;
|
||||||
char *candidate = hash_table[index];
|
char *candidate = hash_table[index];
|
||||||
// Note that hash will be truncated to N (N=30 as it happens) bits
|
|
||||||
// by VALUE_OF().
|
|
||||||
u32 increment = ((hash >> EXPONENT) | 1) % CAPACITY;
|
u32 increment = ((hash >> EXPONENT) | 1) % CAPACITY;
|
||||||
while (candidate) {
|
while (candidate) {
|
||||||
if (hash == VALUE_OF(hash_key(candidate)))
|
if (hash == VALUE_OF(hash_key(candidate)))
|
||||||
|
|
@ -524,7 +524,7 @@ main()
|
||||||
{
|
{
|
||||||
memset(hash_table, 0, sizeof(hash_table));
|
memset(hash_table, 0, sizeof(hash_table));
|
||||||
memset(string_heap, 0, sizeof(string_heap));
|
memset(string_heap, 0, sizeof(string_heap));
|
||||||
/*memset(t2e_stack, 0, sizeof(t2e_stack));*/
|
memset(t2e_stack, 0, sizeof(t2e_stack));
|
||||||
error = NO_ERROR;
|
error = NO_ERROR;
|
||||||
|
|
||||||
// TODO: these should be global.
|
// TODO: these should be global.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue