authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-10-29 05:11:58-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-10-29 05:11:58-07:00
log6568f0f75b900d2ee27363b2ba81bedf206a13e7
tree775a65f7dc164bc1d3cae51488504698ccf8735a
parentb409cdf63f3496032bda83a88f54a7684feab92b
parent63a45b8ecdc9e4babd883be71dde1826f32b556f
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #25705 from squeek502/linked-list-remove-docs

Document that `remove` of Singly/DoublyLinkedList relies on the node being in the list

2 files changed, 3 insertions(+), 0 deletions(-)

lib/std/DoublyLinkedList.zig+1
......@@ -105,6 +105,7 @@ pub fn prepend(list: *DoublyLinkedList, new_node: *Node) void {
105105}
106106
107107/// Remove a node from the list.
108/// Assumes the node is in the list.
108109///
109110/// Arguments:
110111/// node: Pointer to the node to be removed.
lib/std/SinglyLinkedList.zig+2
......@@ -85,6 +85,8 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
8585 list.first = new_node;
8686}
8787
88/// Remove `node` from the list.
89/// Asserts that `node` is in the list.
8890pub fn remove(list: *SinglyLinkedList, node: *Node) void {
8991 if (list.first == node) {
9092 list.first = node.next;