large performance improvement

sorting 400k - 800k files is much faster, and no longer unbearable
This commit is contained in:
Lilian Jónsdóttir 2024-07-15 18:46:39 -07:00
parent 73da0a88fe
commit 20f6dc92bc
4 changed files with 13 additions and 14 deletions

View file

@ -8,17 +8,17 @@ import (
const sep = string(os.PathSeparator)
var (
home string = os.Getenv("HOME")
pwd, _ = os.Getwd()
)
// UnExpand unexpands some directory shortcuts
//
// $HOME -> ~
// $PWD -> .
// workdir -> /
func UnExpand(dir, workdir string) (outdir string) {
var (
home string = os.Getenv("HOME")
pwd, _ = os.Getwd()
)
if dir != "" {
outdir = cleanDir(dir, pwd)
}