Compare commits

..

No commits in common. "master" and "v0.7.4" have entirely different histories.

12
tree.go
View file

@ -3,7 +3,6 @@ package zord_tree
import ( import (
"bufio" "bufio"
"bytes" "bytes"
"cmp"
"crypto/md5" "crypto/md5"
"errors" "errors"
"fmt" "fmt"
@ -14,10 +13,10 @@ import (
"path" "path"
"path/filepath" "path/filepath"
"regexp" "regexp"
"slices"
"strings" "strings"
abcex "g.arns.lt/zordsdavini/abcex/v4" abcex "g.arns.lt/zordsdavini/abcex/v4"
"golang.org/x/exp/slices"
) )
type Config struct { type Config struct {
@ -569,16 +568,7 @@ FILE_LOOP:
if err != nil { if err != nil {
return tree, err return tree, err
} }
if nextFile.Id == "" {
continue
}
tree.Files = append(tree.Files, nextFile) tree.Files = append(tree.Files, nextFile)
slices.SortFunc(tree.Files, func(a, b File) int {
if len(a.Id) == len(b.Id) {
return strings.Compare(a.Id, b.Id)
}
return cmp.Compare(len(a.Id), len(b.Id))
})
} }
return tree, nil return tree, nil