clear
This commit is contained in:
parent
d623d8b2ba
commit
3a8404ccf4
@ -80,18 +80,8 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
|
|
||||||
else{
|
else{
|
||||||
struct car* this = first;
|
struct car* this = first;
|
||||||
while(this!= NULL){
|
while(this->next!= NULL){
|
||||||
//while(this != NULL){
|
int x = strcmp(this->value, target);
|
||||||
int x = strcmp(this->next->value, target);
|
|
||||||
if(x == 0){
|
|
||||||
struct car* temp = this->next->next;
|
|
||||||
this->next = NULL;
|
|
||||||
this->next = temp;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
this = this->next;
|
|
||||||
//}
|
|
||||||
/*int x = strcmp(this->value, target);
|
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
struct car* curr = first;
|
struct car* curr = first;
|
||||||
struct car* prev = NULL;
|
struct car* prev = NULL;
|
||||||
@ -108,7 +98,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
prev->next = curr->next;
|
prev->next = curr->next;
|
||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
this = this->next;*/
|
this = this->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return first;
|
return first;
|
||||||
|
Loading…
Reference in New Issue
Block a user