diff options
author | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
commit | 133c9834756328c4314dc74e341bf9589251b947 (patch) | |
tree | 551225eb8b198927747e30361bc9a4edb4a3a59a /c_lhosts.go | |
parent | awy (diff) | |
download | hardflip-133c9834756328c4314dc74e341bf9589251b947.tar.gz hardflip-133c9834756328c4314dc74e341bf9589251b947.tar.bz2 hardflip-133c9834756328c4314dc74e341bf9589251b947.tar.xz hardflip-133c9834756328c4314dc74e341bf9589251b947.tar.zst hardflip-133c9834756328c4314dc74e341bf9589251b947.zip |
turns out we need litems in the end
Diffstat (limited to 'c_lhosts.go')
-rw-r--r-- | c_lhosts.go | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/c_lhosts.go b/c_lhosts.go index c3d2c77..bddc1c0 100644 --- a/c_lhosts.go +++ b/c_lhosts.go @@ -74,7 +74,6 @@ type HostNode struct { Dynamic bool `yaml:"dynamic"` Note string `yaml:"note"` Filename string - Parent *DirsNode next *HostNode } @@ -85,20 +84,15 @@ type HostList struct { // adds a host node to the list func (lhost *HostList) add_back(node *HostNode) { - new_node := node - - new_node.ID = global_id + node.ID = global_id if lhost.head == nil { - lhost.head = new_node + lhost.head = node lhost.last = lhost.head return } - curr := lhost.last - // for curr.next != nil { - // curr = curr.next - // } - curr.next = new_node - lhost.last = curr.next + last := lhost.last + last.next = node + lhost.last = last.next } func (lhost *HostList) reset_id() { |