src/linkedList.c
/**
 * Removes first instance of a value
 * 
*/
Removes first instance of a value
Removes first instance of a value
void* removeValue(linkedList* l, void* pVal, bool (*comparator)(void*, void*)) {
    node* current = l->head;
    node* previous = NULL;
    while (current) {
        if (comparator(pVal, current->value)) {
            handleRemoval(l, previous, current);
            void* val = current->value;
            free(current);
            return val;
        }
        previous = current;
        current = current->next;
    }
    return NULL;
}
void * removeValue ( linkedList * l , void * pVal , bool ( * comparator ) ( void * , void * ) ) { node * current = l -> head ; node * previous = NULL ; while ( current ) { if ( comparator ( pVal , current -> value ) ) { handleRemoval ( l , previous , current ) ; void * val = current -> value ; free ( current ) ; return val ; } previous = current ; current = current -> next ; } return NULL ; }
Removes first instance of a value
Removes first instance of a value