Skip to content

Commit

Permalink
Skip over even numbers in prime_counts
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Oct 22, 2023
1 parent 57af72a commit edc1b70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,10 @@ pub const fn prime_counts<const N: usize>() -> [usize; N] {
count += 1;
}
counts[i] = count;
i += 1;
if i + 1 < N {
counts[i + 1] = count;
}
i += 2;
}
counts
}
Expand Down

0 comments on commit edc1b70

Please sign in to comment.