Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/std/DoublyLinkedList.zig
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub fn prepend(list: *DoublyLinkedList, new_node: *Node) void {
}

/// Remove a node from the list.
/// Assumes the node is in the list.
///
/// Arguments:
/// node: Pointer to the node to be removed.
Expand Down
2 changes: 2 additions & 0 deletions lib/std/SinglyLinkedList.zig
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
list.first = new_node;
}

/// Remove `node` from 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;
Expand Down