authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-08-22 01:12:34+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-22 02:47:39-04:00
log9ab428185688896ab5b6d4bc924366d22bfe4ccd
tree9bf6d952e2ad03299c1e40bda62b6ca52fa9da2c
parentf18b92ef3ab689749efd135968f0834478f9fffa

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 };

1 files changed, 0 insertions(+), 12 deletions(-)

lib/std/linked_list.zig-12
......@@ -28,12 +28,6 @@ pub fn SinglyLinkedList(comptime T: type) type {
2828
2929 pub const Data = T;
3030
31 pub fn init(data: T) Node {
32 return Node{
33 .data = data,
34 };
35 }
36
3731 /// Insert a new node after the current one.
3832 ///
3933 /// Arguments:
......@@ -175,12 +169,6 @@ pub fn TailQueue(comptime T: type) type {
175169 prev: ?*Node = null,
176170 next: ?*Node = null,
177171 data: T,
178
179 pub fn init(data: T) Node {
180 return Node{
181 .data = data,
182 };
183 }
184172 };
185173
186174 first: ?*Node = null,