diff options
author | Joe <rbo@gmx.us> | 2023-12-27 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2023-12-27 20:20:20 +0100 |
commit | f2590365561991f352091a12178bfd074ce3256a (patch) | |
tree | 74a44ba79fb7eee93a7f5bb2404543cb510a3169 /c_lhosts.go | |
parent | not quite clean (diff) | |
download | hardflip-f2590365561991f352091a12178bfd074ce3256a.tar.gz hardflip-f2590365561991f352091a12178bfd074ce3256a.tar.bz2 hardflip-f2590365561991f352091a12178bfd074ce3256a.tar.xz hardflip-f2590365561991f352091a12178bfd074ce3256a.tar.zst hardflip-f2590365561991f352091a12178bfd074ce3256a.zip |
dirty but that's the way
Diffstat (limited to 'c_lhosts.go')
-rw-r--r-- | c_lhosts.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/c_lhosts.go b/c_lhosts.go index 8486004..fe8f7a0 100644 --- a/c_lhosts.go +++ b/c_lhosts.go @@ -76,6 +76,7 @@ type HostNode struct { type HostList struct { head *HostNode + last *HostNode } // adds a host node to the list @@ -84,14 +85,16 @@ func (lhost *HostList) add_back(node *HostNode) { if lhost.head == nil { lhost.head = new_node + lhost.last = lhost.head return } - curr := lhost.head + curr := lhost.last for curr.next != nil { curr = curr.next } new_node.ID = curr.ID + 1 curr.next = new_node + lhost.last = curr.next } func (lhost *HostList) reset_id() { |