Restore hit clearing when divisor cycle is missing
This commit is contained in:
1 parent
f0b4cdf6e2
commit
ff9b0122c0
1 file changed
+2
-8
@@ -35,14 +35,8 @@ internal sealed class MersenneCpuDivisorScanSession : IMersenneNumberDivisorByDi
|
|||||||
divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor);
|
divisorCycle = DivisorCycleCache.Shared.GetCycleLength(divisor);
|
||||||
if (divisorCycle == 0UL)
|
if (divisorCycle == 0UL)
|
||||||
{
|
{
|
||||||
divisorCycle = MersenneDivisorCycles.CalculateCycleLength(
|
hits.Clear();
|
||||||
divisor,
|
return;
|
||||||
cachedData,
|
|
||||||
skipPrimeOrderHeuristic: true);
|
|
||||||
if (divisorCycle == 0UL)
|
|
||||||
{
|
|
||||||
throw new InvalidOperationException($"Failed to compute a cycle for divisor {divisor}.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user