Skip to content

Commit 0cabd6d

Browse files
committed
Do a further logic simplification
1 parent 16458c6 commit 0cabd6d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

math/wide_integer/uintwide_t.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -7182,7 +7182,9 @@
71827182

71837183
// Loop over the trials to perform the primality testing.
71847184

7185-
for(std::size_t idx { UINT8_C(0) }; ((idx < number_of_trials) && result); ++idx) // NOLINT(altera-id-dependent-backward-branch)
7185+
std::size_t idx { UINT8_C(0) };
7186+
7187+
do
71867188
{
71877189
x = distribution(generator, params);
71887190
y = powm(x, q, np);
@@ -7227,7 +7229,10 @@
72277229
// Mark failure if (y == 1) and (jdx != 0).
72287230
result = false;
72297231
}
7232+
7233+
++idx;
72307234
}
7235+
while((idx < number_of_trials) && result);
72317236

72327237
return result;
72337238
}

0 commit comments

Comments
 (0)