popFirst
Remove and return the first node in the list.
Function parameters
Parameters
- list:*SinglyLinkedList
This struct contains only a next pointer and not any data payload.
Types
- Node
- This struct contains only a next pointer and not any data payload.
Functions in this namespace
Functions
Source
Implementation
pub fn popFirst(list: *SinglyLinkedList) ?*Node {
const first = list.first orelse return null;
list.first = first.next;
return first;
}