mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
std: remove init functions from linked list nodes
These functions are rather useless and redundant as initializing the
struct directly is just as easy:
var node = TailQueue(u32).Node{ .data = 42 };
This commit is contained in:
parent
f18b92ef3a
commit
9ab4281856
@ -28,12 +28,6 @@ pub fn SinglyLinkedList(comptime T: type) type {
|
||||
|
||||
pub const Data = T;
|
||||
|
||||
pub fn init(data: T) Node {
|
||||
return Node{
|
||||
.data = data,
|
||||
};
|
||||
}
|
||||
|
||||
/// Insert a new node after the current one.
|
||||
///
|
||||
/// Arguments:
|
||||
@ -175,12 +169,6 @@ pub fn TailQueue(comptime T: type) type {
|
||||
prev: ?*Node = null,
|
||||
next: ?*Node = null,
|
||||
data: T,
|
||||
|
||||
pub fn init(data: T) Node {
|
||||
return Node{
|
||||
.data = data,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
first: ?*Node = null,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user