diff options
author | Joe <rbo@gmx.us> | 2024-01-11 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-11 20:20:20 +0100 |
commit | 9938cdc8e6e6b644e013de8e1c46771cd7e7ad87 (patch) | |
tree | a07f5598fc7242c0199ef4a0c7d31394063a900e /c_ldirs.go | |
parent | fix that now (diff) | |
download | hardflip-9938cdc8e6e6b644e013de8e1c46771cd7e7ad87.tar.gz hardflip-9938cdc8e6e6b644e013de8e1c46771cd7e7ad87.tar.bz2 hardflip-9938cdc8e6e6b644e013de8e1c46771cd7e7ad87.tar.xz hardflip-9938cdc8e6e6b644e013de8e1c46771cd7e7ad87.tar.zst hardflip-9938cdc8e6e6b644e013de8e1c46771cd7e7ad87.zip |
cool
Diffstat (limited to 'c_ldirs.go')
-rw-r--r-- | c_ldirs.go | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -51,6 +51,8 @@ package main +import "fmt" + type DirsNode struct { ID int Name string @@ -156,17 +158,18 @@ func (dir *DirsNode) count_hosts() int { // return the number of hosts and subfolders of the dir func (dir *DirsNode) count_elements(skip_folds bool, - folds map[*DirsNode]*ItemsList) int { + folds map[*DirsNode]*ItemsList) int { items := 0 items += dir.count_hosts() for ptr := dir.next; ptr != nil && ptr.Depth > dir.Depth; ptr = ptr.next { - if skip_folds == true && lfold := folds[ptr] != nil { - lfold.head - for i := 1; i < count; i++ { + if lfold := folds[ptr]; skip_folds == true && lfold != nil { + count := lfold.last.ID - lfold.head.ID + fmt.Println(count) + // FIX: here + for i := 1; ptr != nil && i < count; i++ { ptr = ptr.next } - // FIX: fix you shit } else { items += ptr.count_hosts() + 1 } |