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
+10 -3
View File
@@ -45,15 +45,22 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
count := 0
for r := rec; r != nil; r = r.pNext {
if r.wType != u16(type) do continue // NOTE(tetra): Should never happen, but...
if r.wType != u16(type) {
// NOTE(tetra): Should never happen, but...
continue
}
count += 1
}
recs := make([dynamic]DNS_Record, 0, count)
if recs == nil do return nil, .System_Error // return no results if OOM.
if recs == nil {
return nil, .System_Error // return no results if OOM.
}
for r := rec; r != nil; r = r.pNext {
if r.wType != u16(type) do continue // NOTE(tetra): Should never happen, but...
if r.wType != u16(type) {
continue // NOTE(tetra): Should never happen, but...
}
base_record := DNS_Record_Base{
record_name = strings.clone(string(r.pName)),