下面的代码片段用于在双向链表中删除一个节点。请在横线处填入( ),使其能正确实现相应功能。
void deleteNode(DoublyListNode * & head, int value) {
DoublyListNode * current = head;
while (current != nullptr && current -> val != value) {
current = current -> next;
}
if (current != nullptr) {
if (current -> prev != nullptr) {
_____________________________ // 在此处填入代码
} else {
head = current -> next;
}
if (current -> next != nullptr) {
current -> next -> prev = current -> prev;
}
delete current;
}
}