clear
This commit is contained in:
parent
2230d9d16e
commit
02f66e152a
@ -62,8 +62,9 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct car* prev = first;
|
struct car* prev = first;
|
||||||
while(prev->next->next != NULL){
|
while(prev->next->next->next != NULL){
|
||||||
int x = strcmp(first->value, target);
|
int x = strcmp(first->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
prev = first->next;
|
prev = first->next;
|
||||||
@ -81,7 +82,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
}
|
}
|
||||||
prev = prev->next;
|
prev = prev->next;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
if(prev->next->next == NULL) {
|
if(prev->next->next == NULL) {
|
||||||
int x = strcmp(first->value, target);
|
int x = strcmp(first->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
@ -96,7 +97,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
free(prev->next);
|
free(prev->next);
|
||||||
prev->next = third;
|
prev->next = third;
|
||||||
}
|
}
|
||||||
}
|
} */
|
||||||
return first;
|
return first;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user