zly return
This commit is contained in:
parent
41d4e7acb0
commit
03dce445b6
@ -48,18 +48,18 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
free(this);
|
free(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}else {
|
}else {
|
||||||
return first;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while( this->next->next != NULL){
|
while( this->next->next != NULL){
|
||||||
if(strcmp(this->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 this;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this = this->next;
|
this = this->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return first;
|
return this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user