Compute missing small divisor cycles on demand

This commit is contained in:
Marek Lemańczyk committed 2025-10-13 18:18:57 +02:00
1 parent c8d6143ab7
commit c81579865c
1 file changed
+5 -8
+5 -8
View File
@@ -80,17 +80,14 @@ public sealed class DivisorCycleCache
if (divisor < (ulong)snapshot.Length)
{
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)