diff options
| author | gingerBill <bill@gingerbill.org> | 2020-10-14 20:47:13 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-10-14 20:47:13 +0100 |
| commit | 7fc3030c636c8b581e3a5c8b50b72590d7d134e6 (patch) | |
| tree | 8eda43b70a8d6b94c7836598a81647f0b933d798 /core/path/filepath | |
| parent | edd802e1ff5c2e01edb39b7d927a2ab2c7ee3b54 (diff) | |
Update path/filepath to use new `slice.sort`; Add `sort.reverse_interface`
Diffstat (limited to 'core/path/filepath')
| -rw-r--r-- | core/path/filepath/match.odin | 6 | ||||
| -rw-r--r-- | core/path/filepath/walk.odin | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/core/path/filepath/match.odin b/core/path/filepath/match.odin index 4ea0851d3..3e94d3fd9 100644 --- a/core/path/filepath/match.odin +++ b/core/path/filepath/match.odin @@ -1,7 +1,7 @@ package filepath import "core:os" -import "core:sort" +import "core:slice" import "core:strings" import "core:unicode/utf8" @@ -284,8 +284,8 @@ _glob :: proc(dir, pattern: string, matches: ^[dynamic]string) -> (m: [dynamic]s fis, _ := os.read_dir(d, -1); - sort.quick_sort_proc(fis, proc(a, b: os.File_Info) -> int { - return sort.compare_strings(a.name, b.name); + slice.sort_proc(fis, proc(a, b: os.File_Info) -> bool { + return a.name < b.name; }); defer { for fi in fis { diff --git a/core/path/filepath/walk.odin b/core/path/filepath/walk.odin index 4143bc557..04424b92e 100644 --- a/core/path/filepath/walk.odin +++ b/core/path/filepath/walk.odin @@ -1,7 +1,7 @@ package filepath import "core:os" -import "core:sort" +import "core:slice" // Walk_Proc is the type of the procedure called for each file or directory visited by 'walk' // The 'path' parameter contains the parameter to walk as a prefix (this is the same as info.fullpath except on 'root') @@ -81,8 +81,8 @@ read_dir :: proc(dir_name: string, allocator := context.temp_allocator) -> ([]os if err != 0 { return nil, err; } - sort.quick_sort_proc(fis, proc(a, b: os.File_Info) -> int { - return sort.compare_strings(a.name, b.name); + slice.sort_proc(fis, proc(a, b: os.File_Info) -> bool { + return a.name < b.name; }); return fis, 0; } |