furt clear
This commit is contained in:
parent
c849f88190
commit
41d4e7acb0
@ -43,16 +43,16 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
if (this == NULL){
|
if (this == NULL){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* if (this->next == NULL){
|
if (this->next == NULL){
|
||||||
if(strcmp(this->value, target) == 0){
|
if(strcmp(this->value, target) == 0){
|
||||||
free(this);
|
free(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}else {
|
}else {
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
while( this->next->next != NULL){
|
while( this->next->next != NULL){
|
||||||
if(strcmp(this->next->value, target) == 0){
|
if(strcmp(this->value, target) == 0){
|
||||||
free(this->next);
|
free(this->next);
|
||||||
this->next = this->next->next;
|
this->next = this->next->next;
|
||||||
return first;
|
return first;
|
||||||
|
Loading…
Reference in New Issue
Block a user