Update Array.h

main
po79yr3at 1 year ago
parent 4c5713efca
commit 84e2ddb800

@ -96,24 +96,16 @@ void Array_delete_pos(struct Array *a, int pos, void (*rel_)(void *)){
}
a->size--;
}
/*删除node所指向的Array节点*/
/*删除node所指向的Array节点的下一个*/
void Array_delete_p(struct Array *a, struct Array_ *node, void (*rel_)(void *)){
assert("Array_delete_p" && node != a->back);
struct Array_ *freeNode;
if(node == a->front){
freeNode = a->front;
a->front = a->front->next;
rel_(freeNode->p);
free(freeNode);
}else{
freeNode = node->next;
node->next = node->next->next;
rel_(freeNode->p);
free(freeNode);
}
freeNode = node->next;
node->next = node->next->next;
rel_(freeNode->p);
free(freeNode);
a->size--;
}
/*交换内容即p指针*/
}p*/
void Array__swap(struct Array_ *a, struct Array_ *b){
void *t = b->p;
b->p = a->p;

Loading…
Cancel
Save