updated performance in why2_deallocate

now if you attempt to deallocate NULL, get_node doesn't go trough the whole list
This commit is contained in:
Václav Šmejkal 2023-08-27 12:18:51 +02:00
parent b1062ad8df
commit a0aabc547a
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -90,7 +90,7 @@ void remove_node(node_t *node)
node_t *get_node(void *pointer)
{
if (head == NULL) return NULL; //EMPTY LIST
if (head == NULL || pointer == NULL) return NULL; //EMPTY LIST
node_t *buffer = head;
while (buffer -> next != NULL)