Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/hash_table.c

    ra35b458 r30f1a25  
    269269
    270270/** Find the next item equal to item. */
    271 ht_link_t *hash_table_find_next(const hash_table_t *h, ht_link_t *item)
     271ht_link_t *
     272hash_table_find_next(const hash_table_t *h, ht_link_t *first, ht_link_t *item)
    272273{
    273274        assert(item);
    274275        assert(h && h->bucket);
    275276
     277        size_t idx = h->op->hash(item) % h->bucket_cnt;
     278
    276279        /* Traverse the circular list until we reach the starting item again. */
    277         for (link_t *cur = item->link.next; cur != &item->link; cur = cur->next) {
     280        for (link_t *cur = item->link.next; cur != &first->link;
     281            cur = cur->next) {
    278282                assert(cur);
     283
     284                if (cur == &h->bucket[idx].head)
     285                        continue;
     286
    279287                ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    280288                /*
Note: See TracChangeset for help on using the changeset viewer.