clearer name

This commit is contained in:
jacekpoz 2024-03-11 01:25:10 +01:00
parent a7d5059475
commit f2f78e0cfa
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

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