Remove usage of do in core library

This commit is contained in:
gingerBill
2020-09-23 17:17:14 +01:00
parent 4844dd4d96
commit fc4fdd588e
45 changed files with 960 additions and 520 deletions
+12 -8
View File
@@ -70,7 +70,9 @@ _less_than_half :: inline proc(x, y: Duration) -> bool {
}
duration_round :: proc(d, m: Duration) -> Duration {
if m <= 0 do return d;
if m <= 0 {
return d;
}
r := d % m;
if d < 0 {
@@ -194,13 +196,15 @@ _abs_date :: proc(abs: u64, full: bool) -> (year: int, month: Month, day: int, y
day = yday;
if _is_leap_year(year) do switch {
case day > 31+29-1:
day -= 1;
case day == 31+29-1:
month = .February;
day = 29;
return;
if _is_leap_year(year) {
switch {
case day > 31+29-1:
day -= 1;
case day == 31+29-1:
month = .February;
day = 29;
return;
}
}
month = Month(day / 31);
+2 -2
View File
@@ -66,8 +66,8 @@ sleep :: proc(d: Duration) {
seconds := u32(ds);
nanoseconds := i64((ds - f64(seconds)) * 1e9);
if seconds > 0 do _unix_sleep(seconds);
if nanoseconds > 0 do nanosleep(nanoseconds);
if seconds > 0 { _unix_sleep(seconds); }
if nanoseconds > 0 { nanosleep(nanoseconds); }
}
nanosleep :: proc(nanoseconds: i64) -> int {