diff options
Diffstat (limited to 'ares_llist.c')
-rw-r--r-- | ares_llist.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/ares_llist.c b/ares_llist.c index c0acd90..36ca84c 100644 --- a/ares_llist.c +++ b/ares_llist.c @@ -61,26 +61,3 @@ void ares__remove_from_list(struct list_node* node) { } } -/* Swap the contents of two lists */ -void ares__swap_lists(struct list_node* head_a, - struct list_node* head_b) { - int is_a_empty = ares__is_list_empty(head_a); - int is_b_empty = ares__is_list_empty(head_b); - struct list_node old_a = *head_a; - struct list_node old_b = *head_b; - - if (is_a_empty) { - ares__init_list_head(head_b); - } else { - *head_b = old_a; - old_a.next->prev = head_b; - old_a.prev->next = head_b; - } - if (is_b_empty) { - ares__init_list_head(head_a); - } else { - *head_a = old_b; - old_b.next->prev = head_a; - old_b.prev->next = head_a; - } -} |