list/list.c
/* remove element at index from list */
remove element at index from list
remove element at index from list
Node*
List_detach(List* list, unsigned int index)
{
	Node* node = List_at(list, index);
	if (node)
	{
		XFDBG("detach node %u", index);
		if (node->previous)
			node->previous->next = node->next;
		else
			list->first = node->next;
		if (node->next)
			node->next->previous = node->previous;
		else
			list->last = node->previous;
		list->length--;
	}
	return node;
}
Node * List_detach ( List * list , unsigned int index ) { Node * node = List_at ( list , index ) ; if ( node ) { XFDBG ( " " , index ) ; if ( node -> previous ) node -> previous -> next = node -> next ; else list -> first = node -> next ; if ( node -> next ) node -> next -> previous = node -> previous ; else list -> last = node -> previous ; list -> length -- ; } return node ; }
remove element at index from list
remove element at index from list