@returns {T|null}
()
| 874 | } |
| 875 | /** @returns {T|null} */ |
| 876 | shift() { |
| 877 | const tail = this.tail; |
| 878 | const next = tail.shift(); |
| 879 | if (tail.isEmpty() && tail.next !== null) { |
| 880 | this.tail = tail.next; |
| 881 | tail.next = null; |
| 882 | } |
| 883 | return next; |
| 884 | } |
| 885 | }; |
| 886 | } |
| 887 | }); |