diff options
author | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-05 20:20:20 +0100 |
commit | 4b06549cd72411db72ae231e5ad6b1ae16ca0fbf (patch) | |
tree | 7ec03fae7cb66b388d3939658523e8be603c6387 /c_init.go | |
parent | todolist (diff) | |
download | hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.gz hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.bz2 hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.xz hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.tar.zst hardflip-4b06549cd72411db72ae231e5ad6b1ae16ca0fbf.zip |
cool
Diffstat (limited to '')
-rw-r--r-- | c_init.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 } |