Skip to content

Commit 27e2cba

Browse files
committed
Add some comments
1 parent e9d629c commit 27e2cba

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/generate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ pub const fn primes_lt<const N: usize, const MEM: usize>(
196196
// Sieve for primes in the segment.
197197
let (offset, upper_sieve) = match sieve_segment(&base_sieve, upper_limit) {
198198
Ok(res) => (0, res),
199+
// The segment was larger than there are numbers left to sieve, just use the base sieve
199200
Err(_) => ((MEM as u64 - upper_limit) as usize, base_sieve),
200201
};
201202

src/sieve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub const fn sieve_lt<const N: usize, const MEM: usize>(
173173
// Use the result to sieve the higher range.
174174
let (offset, upper_sieve) = match sieve_segment(&base_sieve, upper_limit) {
175175
Ok(res) => (0, res),
176-
// The sieve contained more entries than there are non-negative numbers below the upper limit.
176+
// The sieve contained more entries than there are non-negative numbers below the upper limit, just use the base sieve.
177177
Err(_) => ((MEM as u64 - upper_limit) as usize, base_sieve),
178178
};
179179

0 commit comments

Comments
 (0)