mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +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
@ -86,7 +86,7 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Remove `node` from the list.
|
/// 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 {
|
pub fn remove(list: *SinglyLinkedList, node: *Node) void {
|
||||||
if (list.first == node) {
|
if (list.first == node) {
|
||||||
list.first = node.next;
|
list.first = node.next;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user