Skip to content

Commit

Permalink
Minor hash_iter() code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Nov 11, 2011
1 parent 5af2b9c commit 585f4b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mojoshader_common.c
Expand Up @@ -62,21 +62,21 @@ int hash_find(const HashTable *table, const void *key, const void **_value)
int hash_iter(const HashTable *table, const void *key,
const void **_value, void **iter)
{
HashItem *i = *iter;
if (i == NULL)
i = table->table[calc_hash(table, key)];
HashItem *item = *iter;
if (item == NULL)
item = table->table[calc_hash(table, key)];
else
i = i->next;
item = item->next;

while (i != NULL)
while (item != NULL)
{
if (table->keymatch(key, i->key, table->data))
if (table->keymatch(key, item->key, table->data))
{
*_value = i->value;
*iter = i;
*_value = item->value;
*iter = item;
return 1;
} // if
i = i->next;
item = item->next;
} // while

// no more matches.
Expand Down

0 comments on commit 585f4b5

Please sign in to comment.