remove rt_list_for_each

This commit is contained in:
Chris Copeland 2023-12-18 01:39:36 -08:00
parent 2ba14d5f11
commit 8e38fc67e7
Signed by: chrisnc
GPG Key ID: 14550DA72485DF30
2 changed files with 4 additions and 7 deletions

View File

@ -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 \

View File

@ -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);
}