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
+4 -2
+4 -2
View File
@@ -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;
} }