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_ldirs.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_ldirs.go')
-rw-r--r-- | c_ldirs.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -59,6 +59,7 @@ type DirsNode struct { type DirsList struct { head *DirsNode + last *DirsNode } // adds a directory node to the list @@ -67,13 +68,15 @@ func (ldirs *DirsList) add_back(node *DirsNode) { if ldirs.head == nil { ldirs.head = new_node + ldirs.last = ldirs.head return } - curr := ldirs.head + curr := ldirs.last for curr.next != nil { curr = curr.next } curr.next = new_node + ldirs.last = curr.next } // return the list node with the according id |