authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-10-25 21:28:54-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-10-25 21:28:54-07:00
log63a45b8ecdc9e4babd883be71dde1826f32b556f
treed1ecd9d7e85ebd6ecca25f37a647b7d6ac19b335
parenta83db33ba2d5fddcc453735a7a0d9b57c67739a8

SinglyLinkedList.remove docs: Assumes -> asserts

Removing a node that is not in the list invokes safety-checked illegal behavior, so "asserts" is the recommended language to use.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/SinglyLinkedList.zig+1-1
...@@ -86,7 +86,7 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {...@@ -86,7 +86,7 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
86}86}
8787
88/// Remove `node` from the list.88/// Remove `node` from the list.
89/// Assumes `node` is in the list.89/// Asserts that `node` is in the list.
90pub fn remove(list: *SinglyLinkedList, node: *Node) void {90pub fn remove(list: *SinglyLinkedList, node: *Node) void {
91 if (list.first == node) {91 if (list.first == node) {
92 list.first = node.next;92 list.first = node.next;