clearer name
This commit is contained in:
parent
a7d5059475
commit
f2f78e0cfa
1 changed files with 6 additions and 6 deletions
|
@ -30,14 +30,14 @@ void doubly_linked_list_insert(DoublyLinkedList *l, void *value) {
|
|||
return;
|
||||
}
|
||||
|
||||
Node *current = l->head;
|
||||
while (current->next != l->head) {
|
||||
current = current->next;
|
||||
Node *tail = l->head;
|
||||
while (tail->next != l->head) {
|
||||
tail = tail->next;
|
||||
}
|
||||
|
||||
current->next = node_new(value, l->element_size);
|
||||
current->next->next = l->head;
|
||||
current->next->prev = current;
|
||||
tail->next = node_new(value, l->element_size);
|
||||
tail->next->next = l->head;
|
||||
tail->next->prev = tail;
|
||||
l->length += 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue