Compute missing small divisor cycles on demand
This commit is contained in:
1 parent
c8d6143ab7
commit
c81579865c
1 file changed
+4
-7
@@ -80,18 +80,15 @@ public sealed class DivisorCycleCache
|
|||||||
if (divisor < (ulong)snapshot.Length)
|
if (divisor < (ulong)snapshot.Length)
|
||||||
{
|
{
|
||||||
ulong cached = snapshot[divisor];
|
ulong cached = snapshot[divisor];
|
||||||
if (cached == 0UL)
|
if (cached != 0UL)
|
||||||
{
|
{
|
||||||
throw new InvalidDataException($"Divisor cycle is missing for {divisor}");
|
cycles[i] = cached;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cycles[i] = cached;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
missingBuffer[missingCount++] = i;
|
missingBuffer[missingCount++] = i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (missingCount != 0)
|
if (missingCount != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user