Skip to content

Commit

Permalink
Improve date comparison speed
Browse files Browse the repository at this point in the history
  • Loading branch information
jrstrunk committed Jan 16, 2025
1 parent 99eff05 commit c1dfcd2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/tempo.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -1944,11 +1944,7 @@ pub fn date_compare(a: Date, to b: Date) -> order.Order {
case a.year == b.year {
True ->
case a.month == b.month {
True ->
case a.day == b.day {
True -> order.Eq
False -> int.compare(a.day, b.day)
}
True -> int.compare(a.day, b.day)
False ->
int.compare(
month_to_int(a |> date_get_month),
Expand Down

0 comments on commit c1dfcd2

Please sign in to comment.