[libcxx-commits] [libcxx] [libcxx] Use a table for the offsets in __next_prime (PR #180651)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 12 02:23:11 PST 2026


================
@@ -30,6 +30,13 @@ const unsigned indices[] = {
     71,  73,  79,  83,  89,  97,  101, 103, 107, 109, 113, 121, 127, 131, 137, 139,
     143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209};
 
+// These are the amount we increment by when checking for potential
+// primes in the  loop in __next_prime.
+const size_t increments[] = {
----------------
philnik777 wrote:

```suggestion
const uint8_t increments[] = {
```
Might as well save a few bytes.

https://github.com/llvm/llvm-project/pull/180651


More information about the libcxx-commits mailing list