Skip to content

Commit

Permalink
Improve macro comment and collapse if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Oct 13, 2023
1 parent ec40425 commit f3a1551
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,9 @@ pub const fn moebius(x: core::num::NonZeroU64) -> i8 {
if x % $factor == 0 {
x /= $factor;
prime_count += 1;
// This checks if factor^2 divides x.
if x % $factor == 0 {
return 0;
}
// If x is still divisible by the factor that means x has a
// square or more prime factor, and we return 0.
if x % $factor == 0 { return 0; }
}
)+
};
Expand Down

0 comments on commit f3a1551

Please sign in to comment.