Restore snapshot missing-cycle guard
This commit is contained in:
1 parent
c81579865c
commit
a255dc718d
1 file changed
+4
-2
@@ -80,12 +80,14 @@ 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;
|
cycles[i] = cached;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
missingBuffer[missingCount++] = i;
|
missingBuffer[missingCount++] = i;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user