* Delete the list element the iterator currently points to. * * Caution: this modifies iter->cur, so don't use that again in the current * loop iteration. */
| 668 | * loop iteration. |
| 669 | */ |
| 670 | static inline void |
| 671 | slist_delete_current(slist_mutable_iter *iter) |
| 672 | { |
| 673 | /* |
| 674 | * Update previous element's forward link. If the iteration is at the |
| 675 | * first list element, iter->prev will point to the list header's "head" |
| 676 | * field, so we don't need a special case for that. |
| 677 | */ |
| 678 | iter->prev->next = iter->next; |
| 679 | |
| 680 | /* |
| 681 | * Reset cur to prev, so that prev will continue to point to the prior |
| 682 | * valid list element after slist_foreach_modify() advances to the next. |
| 683 | */ |
| 684 | iter->cur = iter->prev; |
| 685 | } |
| 686 | |
| 687 | /* |
| 688 | * Return the containing struct of 'type' where 'membername' is the slist_node |
no outgoing calls
no test coverage detected