remove rt_list_for_each
This commit is contained in:
parent
2ba14d5f11
commit
8e38fc67e7
|
@ -26,9 +26,6 @@ void rt_list_insert_by(struct rt_list *list, struct rt_list *node,
|
|||
bool (*cmp)(const struct rt_list *,
|
||||
const struct rt_list *));
|
||||
|
||||
#define rt_list_for_each(node, listp) \
|
||||
for (node = rt_list_front((listp)); node != (listp); node = node->next)
|
||||
|
||||
#define RT_LIST_INIT(name) \
|
||||
{ \
|
||||
.prev = &name, .next = &name \
|
||||
|
|
|
@ -43,13 +43,13 @@ void rt_list_insert_by(struct rt_list *list, struct rt_list *node,
|
|||
bool (*cmp)(const struct rt_list *,
|
||||
const struct rt_list *))
|
||||
{
|
||||
struct rt_list *successor;
|
||||
rt_list_for_each(successor, list)
|
||||
struct rt_list *next;
|
||||
for (next = rt_list_front(list); next != list; next = next->next)
|
||||
{
|
||||
if (cmp(node, successor))
|
||||
if (cmp(node, next))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
insert(node, successor->prev, successor);
|
||||
insert(node, next->prev, next);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue