(node: ListNode<T> | EmptyNode)
| 736 | } |
| 737 | |
| 738 | private remove(node: ListNode<T> | EmptyNode): T | null { |
| 739 | if (node === this.head || this.length === 0) { |
| 740 | return null; |
| 741 | } |
| 742 | |
| 743 | this.count -= 1; |
| 744 | |
| 745 | const prevNode = node.prev; |
| 746 | const nextNode = node.next; |
| 747 | prevNode.next = nextNode; |
| 748 | nextNode.prev = prevNode; |
| 749 | |
| 750 | return node.value; |
| 751 | } |
| 752 | |
| 753 | /** Removes the first node at the front of the list */ |
| 754 | shift(): T | null { |
no outgoing calls
no test coverage detected