Use or_else in the core library when it makes sense

This commit is contained in:
gingerBill
2021-07-05 16:33:01 +01:00
parent 3b9ca8535f
commit 9b3a0251ca
5 changed files with 6 additions and 29 deletions
+2 -5
View File
@@ -57,11 +57,8 @@ link_error_delete :: proc(lerr: Maybe(Link_Error)) {
is_platform_error :: proc(ferr: Error) -> (err: i32, ok: bool) {
v: Platform_Error;
if v, ok = ferr.(Platform_Error); ok {
err = v.err;
}
return;
v := or_else(ferr.(Platform_Error), {});
return v.err, v.err != 0;
}