Revert "Add iterator API". Will try to find a better API

This reverts commit 821399a61b.
This commit is contained in:
Nils O. Selåsdal
2013-10-24 21:28:35 +02:00
parent 821399a61b
commit 45ecb3c1e0
2 changed files with 0 additions and 81 deletions
-44
View File
@@ -171,47 +171,3 @@ int uc_htable_resize(struct UHTable *table, size_t buckets)
}
struct UHNode *uc_htable_iter_first_hash(struct UHTable *table,
struct UHIter *iter, size_t hash)
{
size_t bucket = uc_htable_bucket(table, hash);
struct UHNode **it= &table->buckets[bucket];
while (*it) {
if ((*it)->hash == hash) {
iter->it = it;
iter->cur_bucket = bucket;
iter->cur_hash = (*it)->hash;
iter->next = &(*it)->next;
return *it;
}
it = &(*it)->next;
}
return NULL;
}
struct UHNode *uc_htable_iter_next_hash(struct UHIter *iter)
{
struct UHNode **it = iter->next;
while (*it) {
if ((*it)->hash == iter->cur_hash) {
iter->it = it;
iter->next = &(*it)->next;
return *it;
}
it = &(*it)->next;
}
return NULL;
}
void uc_htable_iter_remove(struct UHIter *iter)
{
if (*iter->it) {
*iter->it = *iter->next;
iter->it = NULL;
}
}