Restore hit clearing when divisor cycle is missing

This commit is contained in:
Marek Lemańczyk committed 2025-10-23 01:48:06 +02:00
1 parent f0b4cdf6e2
commit ff9b0122c0
1 file changed
+2 -8
@@ -35,14 +35,8 @@ internal sealed class MersenneCpuDivisorScanSession : IMersenneNumberDivisorByDi
divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor);
if (divisorCycle == 0UL)
{
divisorCycle = MersenneDivisorCycles.CalculateCycleLength(
divisor,
cachedData,
skipPrimeOrderHeuristic: true);
if (divisorCycle == 0UL)
{
throw new InvalidOperationException($"Failed to compute a cycle for divisor {divisor}.");
}
hits.Clear();
return;
}
}