aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-27 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-27 20:20:20 +0100
commitf2590365561991f352091a12178bfd074ce3256a (patch)
tree74a44ba79fb7eee93a7f5bb2404543cb510a3169 /c_ldirs.go
parentnot quite clean (diff)
downloadhardflip-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.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index 468b542..199927a 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -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