From 15a5c7ef0fc68c2ca1b2554a1e7bdada62c7dd06 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Tue, 3 Sep 2024 23:15:12 -0500 Subject: [PATCH] Dangling else --- c/src/include/primes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c/src/include/primes.h b/c/src/include/primes.h index 24a45b90..ee7fdbf8 100644 --- a/c/src/include/primes.h +++ b/c/src/include/primes.h @@ -80,7 +80,7 @@ uintmax_t advance_prime_counter(prime_counter *pc) { } } if (!broken) { // is prime - if (pc->idx == prime_cache_idx) + if (pc->idx == prime_cache_idx) { #ifdef PRIME_CACHE_SIZE_LIMIT if (prime_cache_size == prime_cache_idx && prime_cache_size < PRIME_CACHE_SIZE_LIMIT) #else @@ -101,6 +101,7 @@ uintmax_t advance_prime_counter(prime_counter *pc) { } else prime_cache[prime_cache_idx++] = p; + } pc->idx++; if ((pc->exhausted = (p >= pc->stop))) return 0;