Restore snapshot missing-cycle guard

This commit is contained in:
Marek Lemańczyk committed 2025-10-13 18:21:22 +02:00
1 parent c81579865c
commit a255dc718d
1 file changed
+5 -3
+5 -3
View File
@@ -80,11 +80,13 @@ public sealed class DivisorCycleCache
if (divisor < (ulong)snapshot.Length)
{
ulong cached = snapshot[divisor];
if (cached != 0UL)
if (cached == 0UL)
{
cycles[i] = cached;
continue;
throw new InvalidDataException($"Divisor cycle is missing for {divisor}");
}
cycles[i] = cached;
continue;
}
missingBuffer[missingCount++] = i;