下面的代码片段用于在双向链表中删除一个节点。请在横线处填入正确代码,使其能正确实现相应功能。
1 void deleteNode(DoublyListNode*& head, int value) {
2 DoublyListNode* current = head;
3 while (current != nullptr && current->val != value) {
4 current = current->next;
5 }
6 if (current != nullptr) {
7 if (current->prev != nullptr) {
8 ____________________________________ // 在此处填入代码
9 } else {
10 head = current->next;
11 }
12 if (current->next != nullptr) {
13 current->next->prev = current->prev;
14 }
15 delete current;
16 }
17 }