From 4b06549cd72411db72ae231e5ad6b1ae16ca0fbf Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 5 Jan 2024 20:20:20 +0100 Subject: cool --- c_init.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'c_init.go') diff --git a/c_init.go b/c_init.go index b5caf6a..222c796 100644 --- a/c_init.go +++ b/c_init.go @@ -113,10 +113,18 @@ func c_load_data_dir(dir string, opts HardOpts) *DirsList { return &ldirs } +// fills litems sorting with dirs last +// other sorting algos are concievable func c_load_litems(ldirs *DirsList) *ItemsList { litems := ItemsList{} - for dir := ldirs.head; dir != nil; dir = dir.next { + for ptr := ldirs.head; ptr != nil; ptr = ptr.next { + item := ItemsNode{ Dirs: ptr, Host: nil } + litems.add_back(&item) + for ptr := ptr.lhost.head; ptr != nil; ptr = ptr.next { + item := ItemsNode{ Dirs: nil, Host: ptr } + litems.add_back(&item) + } } return &litems } -- cgit v1.2.3