aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-05 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-05 20:20:20 +0100
commit133c9834756328c4314dc74e341bf9589251b947 (patch)
tree551225eb8b198927747e30361bc9a4edb4a3a59a /c_ldirs.go
parentawy (diff)
downloadhardflip-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_ldirs.go')
-rw-r--r--c_ldirs.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index 880c1b7..7188d5b 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -68,20 +68,15 @@ type DirsList struct {
// adds a directory node to the list
func (ldirs *DirsList) add_back(node *DirsNode) {
- new_node := node
-
- new_node.ID = global_id
+ node.ID = global_id
if ldirs.head == nil {
- ldirs.head = new_node
+ ldirs.head = node
ldirs.last = ldirs.head
return
}
- curr := ldirs.last
- // for curr.next != nil {
- // curr = curr.next
- // }
- curr.next = new_node
- ldirs.last = curr.next
+ last := ldirs.last
+ last.next = node
+ ldirs.last = last.next
}
// return the list node with the according id