История изменений
Исправление bormant, (текущая версия) :
Это сильно лучше исходного?
void removeAllNodes(struct Node** head_ref, int key) {
struct Node** pcur = head_ref;
while (*pcur)
if ((*pcur)->data == key) {
struct Node* tmp = *pcur;
*pcur = (*pcur)->next;
free(tmp);
} else
pcur = &(*pcur)->next;
}
Исходная версия bormant, :
Это сильно лучше исходного?
void removeAllNodes(struct Node** head_ref, int key) {
struct Node** pcur = head_ref;
while (*pcur)
if ((*pcur)->data == key) {
struct Node* tmp = *pcur;
*pcur = (*pcur)->next;
free(tmp);
} else
pcur = &(*pcur)->next;
}