From 126c13a9234317769088337bea9e263fd588c71c Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 11 Jan 2024 20:20:20 +0100 Subject: folded was useless indeed --- c_ldirs.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'c_ldirs.go') diff --git a/c_ldirs.go b/c_ldirs.go index 688c119..393e6dd 100644 --- a/c_ldirs.go +++ b/c_ldirs.go @@ -57,7 +57,6 @@ type DirsNode struct { Parent *DirsNode Depth uint16 lhost *HostList - Folded bool next *DirsNode } @@ -156,12 +155,13 @@ func (dir *DirsNode) count_hosts() int { } // return the number of hosts and subfolders of the dir -func (dir *DirsNode) count_elements(skip_folds bool) int { +func (dir *DirsNode) count_elements(skip_folds bool, + 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 && ptr.Folded == true { + if skip_folds == true && folds[dir] != nil { items += 1 // HACK: key to the map is the key // TODO: fix you shit -- cgit v1.2.3