diff options
| author | Tetralux <tetraluxonpc@gmail.com> | 2022-05-21 04:45:04 +0000 |
|---|---|---|
| committer | Tetralux <tetraluxonpc@gmail.com> | 2022-05-21 04:48:06 +0000 |
| commit | 06884da42b8a6a25f3d12f8ab7cfd08c21f4fa36 (patch) | |
| tree | 9da2e552fdb383e718e0538d8b4637b82eec12c5 /core/path/filepath | |
| parent | 6e7179d8f3b1bb8394093b55a1af459013048fca (diff) | |
[path/filepath] Change join() to take a []string instead of varargs
This makes passing an allocator easier, as you no longer have to resort to
named arguments:
Before:
`join(a, b, c)` became `join(elems={a, b, c}, allocator=ally)`
After:
`join({a, b, c})` becomes `join({a, b, c}, ally)`
Diffstat (limited to 'core/path/filepath')
| -rw-r--r-- | core/path/filepath/match.odin | 2 | ||||
| -rw-r--r-- | core/path/filepath/path_unix.odin | 2 | ||||
| -rw-r--r-- | core/path/filepath/path_windows.odin | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/core/path/filepath/match.odin b/core/path/filepath/match.odin index 252912710..00a9c9fb0 100644 --- a/core/path/filepath/match.odin +++ b/core/path/filepath/match.odin @@ -305,7 +305,7 @@ _glob :: proc(dir, pattern: string, matches: ^[dynamic]string, allocator := cont n := fi.name matched := match(pattern, n) or_return if matched { - append(&m, join(dir, n)) + append(&m, join({dir, n})) } } return diff --git a/core/path/filepath/path_unix.odin b/core/path/filepath/path_unix.odin index d0eaa3635..8faf6097c 100644 --- a/core/path/filepath/path_unix.odin +++ b/core/path/filepath/path_unix.odin @@ -38,7 +38,7 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) { return path_str, true } -join :: proc(elems: ..string, allocator := context.allocator) -> string { +join :: proc(elems: []string, allocator := context.allocator) -> string { for e, i in elems { if e != "" { p := strings.join(elems[i:], SEPARATOR_STRING, context.temp_allocator) diff --git a/core/path/filepath/path_windows.odin b/core/path/filepath/path_windows.odin index 28238dd6e..cdfe3ddbb 100644 --- a/core/path/filepath/path_windows.odin +++ b/core/path/filepath/path_windows.odin @@ -88,7 +88,7 @@ abs :: proc(path: string, allocator := context.allocator) -> (string, bool) { } -join :: proc(elems: ..string, allocator := context.allocator) -> string { +join :: proc(elems: []string, allocator := context.allocator) -> string { for e, i in elems { if e != "" { return join_non_empty(elems[i:], allocator) |