Changeset feeac0d in mainline for uspace/srv/ns


Ignore:
Timestamp:
2013-09-10T16:32:35Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

Location:
uspace/srv/ns
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/service.c

    re8d6ce2 rfeeac0d  
    106106{
    107107loop:
    108         list_foreach(pending_conn, cur) {
    109                 pending_conn_t *pr = list_get_instance(cur, pending_conn_t, link);
    110                
     108        list_foreach(pending_conn, link, pending_conn_t, pr) {
    111109                ht_link_t *link = hash_table_find(&service_hash_table, &pr->service);
    112110                if (!link)
     
    117115                    pr->arg3, 0, IPC_FF_NONE);
    118116               
    119                 list_remove(cur);
     117                list_remove(&pr->link);
    120118                free(pr);
    121119                goto loop;
  • uspace/srv/ns/task.c

    re8d6ce2 rfeeac0d  
    179179       
    180180loop:
    181         list_foreach(pending_wait, cur) {
    182                 pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link);
    183                
     181        list_foreach(pending_wait, link, pending_wait_t, pr) {
    184182                ht_link_t *link = hash_table_find(&task_hash_table, &pr->id);
    185183                if (!link)
     
    198196               
    199197                hash_table_remove(&task_hash_table, &pr->id);
    200                 list_remove(cur);
     198                list_remove(&pr->link);
    201199                free(pr);
    202200                goto loop;
Note: See TracChangeset for help on using the changeset viewer.