mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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.
This commit is contained in:
parent
a83db33ba2
commit
63a45b8ecd
1 changed files with 1 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
|
|||
}
|
||||
|
||||
/// Remove `node` from the list.
|
||||
/// Assumes `node` is in the list.
|
||||
/// Asserts that `node` is in the list.
|
||||
pub fn remove(list: *SinglyLinkedList, node: *Node) void {
|
||||
if (list.first == node) {
|
||||
list.first = node.next;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue