Fork us on GitHub Follow us on Facebook Follow us on Twitter

Ignore:
Timestamp:
2013-09-10T16:32:35Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/hash_table.c

    re8d6ce2 rfeeac0d  
    227227       
    228228        /* Check for duplicates. */
    229         list_foreach(h->bucket[idx], cur) {
     229        list_foreach(h->bucket[idx], link, ht_link_t, cur_link) {
    230230                /*
    231231                 * We could filter out items using their hashes first, but
    232232                 * calling equal() might very well be just as fast.
    233233                 */
    234                 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
    235234                if (h->op->equal(cur_link, item))
    236235                        return false;
     
    258257        size_t idx = h->op->key_hash(key) % h->bucket_cnt;
    259258
    260         list_foreach(h->bucket[idx], cur) {
    261                 ht_link_t *cur_link = member_to_inst(cur, ht_link_t, link);
     259        list_foreach(h->bucket[idx], link, ht_link_t, cur_link) {
    262260                /*
    263261                 * Is this is the item we are looking for? We could have first
Note: See TracChangeset for help on using the changeset viewer.