Unlink a node without adjusting its next, prev, and parent pointers.
| 669 | |
| 670 | // Unlink a node without adjusting its next, prev, and parent pointers. |
| 671 | static void S_node_unlink(cmark_node *node) { |
| 672 | if (node == NULL) { |
| 673 | return; |
| 674 | } |
| 675 | |
| 676 | if (node->prev) { |
| 677 | node->prev->next = node->next; |
| 678 | } |
| 679 | if (node->next) { |
| 680 | node->next->prev = node->prev; |
| 681 | } |
| 682 | |
| 683 | // Adjust first_child and last_child of parent. |
| 684 | cmark_node *parent = node->parent; |
| 685 | if (parent) { |
| 686 | if (parent->first_child == node) { |
| 687 | parent->first_child = node->next; |
| 688 | } |
| 689 | if (parent->last_child == node) { |
| 690 | parent->last_child = node->prev; |
| 691 | } |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | void cmark_node_unlink(cmark_node *node) { |
| 696 | S_node_unlink(node); |
no outgoing calls
no test coverage detected