Use or_break and or_continue where appropriate in the core library

This commit is contained in:
gingerBill
2023-09-30 15:34:39 +01:00
parent 41a22bd83d
commit 14adcb9db8
14 changed files with 92 additions and 142 deletions
+1 -3
View File
@@ -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
}
}
+2 -3
View File
@@ -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
}