- if (cur_match != NULL &&
- cur_match->type & iter->type)
- goto found;
- cur_node = TAILQ_NEXT(cur_node, next);
- while (cur_node != NULL) {
- cur_match = TAILQ_FIRST(&cur_node->items);
- if (cur_match != NULL &&
- cur_match->type & iter->type)
- goto found;
- cur_node = TAILQ_NEXT(cur_node, next);
+ }
+ cur_grp = TAILQ_NEXT(cur_grp, next);
+ while (cur_grp != NULL) {
+ TAILQ_FOREACH(cur_match, &cur_grp->items, next) {
+ if (cur_match->type & type)
+ return cur_match;