Skip to content

Commit 34f5d5d

Browse files
committed
refaxctor
1 parent 10c288b commit 34f5d5d

3 files changed

Lines changed: 250 additions & 259 deletions

File tree

std/assembly/date.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function dayOfWeek(year: i32, month: i32, day: i32): i32 {
362362

363363
year -= i32(month < 3);
364364
const century = floorDiv(year >> 2, 100 >> 2);
365-
year += (year >> 2) + (century >> 2) - century;
365+
year += (year >> 2) - century + (century >> 2);
366366
month = <i32>load<u8>(tab + month - 1);
367367
return euclidRem(year + month + day, 7);
368368
}

tests/compiler/std/date.debug.wat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2746,11 +2746,11 @@
27462746
i32.const 2
27472747
i32.shr_s
27482748
local.get $century
2749+
i32.sub
2750+
local.get $century
27492751
i32.const 2
27502752
i32.shr_s
27512753
i32.add
2752-
local.get $century
2753-
i32.sub
27542754
i32.add
27552755
local.set $year
27562756
i32.const 556

0 commit comments

Comments
 (0)