aboutsummaryrefslogtreecommitdiff
path: root/core/path/filepath
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-30 15:34:39 +0100
committergingerBill <bill@gingerbill.org>2023-09-30 15:34:39 +0100
commit14adcb9db89f4a668210a56d909cdca96088aae2 (patch)
tree3f11a5d5ca0dd638387abc60e6cc50a8e1604d0c /core/path/filepath
parent41a22bd83d9458249a60a9d1415f4862f1593b76 (diff)
Use `or_break` and `or_continue` where appropriate in the core library
Diffstat (limited to 'core/path/filepath')
-rw-r--r--core/path/filepath/match.odin4
-rw-r--r--core/path/filepath/path.odin5
2 files changed, 3 insertions, 6 deletions
diff --git a/core/path/filepath/match.odin b/core/path/filepath/match.odin
index fe67ebe2c..1279bdd84 100644
--- a/core/path/filepath/match.odin
+++ b/core/path/filepath/match.odin
@@ -99,9 +99,7 @@ scan_chunk :: proc(pattern: string) -> (star: bool, chunk, rest: string) {
case ']':
in_range = false
case '*':
- if !in_range {
- break scan_loop
- }
+ in_range or_break scan_loop
}
}
diff --git a/core/path/filepath/path.odin b/core/path/filepath/path.odin
index fa47e483d..21183e0f7 100644
--- a/core/path/filepath/path.odin
+++ b/core/path/filepath/path.odin
@@ -392,9 +392,8 @@ rel :: proc(base_path, target_path: string, allocator := context.allocator) -> (
for ti < tl && target[ti] != SEPARATOR {
ti += 1
}
- if !strings.equal_fold(target[t0:ti], base[b0:bi]) {
- break
- }
+ strings.equal_fold(target[t0:ti], base[b0:bi]) or_break
+
if bi < bl {
bi += 1
}