Skip to content

Commit

Permalink
perf: Reorder conditions in is_leap_year (pola-rs#19602)
Browse files Browse the repository at this point in the history
  • Loading branch information
janpipek authored and tylerriccio33 committed Nov 8, 2024
1 parent ae06d35 commit 5f3e1e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/polars-time/src/windows/calendar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub(crate) const DAYS_PER_MONTH: [[i64; 12]; 2] = [
];

pub(crate) const fn is_leap_year(year: i32) -> bool {
year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)
year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
}
/// nanoseconds per unit
pub const NS_MICROSECOND: i64 = 1_000;
Expand Down

0 comments on commit 5f3e1e7

Please sign in to comment.