Merge branch 'codex/analyze-gc-instances-in-checkdivisors-method' of https://github.com/mlemanczyk/even-perfect-numbers-scanner into codex/analyze-gc-instances-in-checkdivisors-method
This commit is contained in:
commit
06b08708d9
1 file changed
+14
-8
@@ -852,7 +852,9 @@ internal static partial class PrimeOrderCalculator
|
||||
compositeStack.Push(remaining);
|
||||
pending.Clear();
|
||||
|
||||
long timestamp = 0L;
|
||||
bool pollardRhoDeadlineReached = Stopwatch.GetTimestamp() > deadlineTimestamp;
|
||||
if (!pollardRhoDeadlineReached)
|
||||
{
|
||||
while (compositeStack.Count > 0)
|
||||
{
|
||||
ulong composite = compositeStack.Pop();
|
||||
@@ -874,13 +876,6 @@ internal static partial class PrimeOrderCalculator
|
||||
continue;
|
||||
}
|
||||
|
||||
timestamp = Stopwatch.GetTimestamp();
|
||||
if (timestamp > deadlineTimestamp)
|
||||
{
|
||||
pending.Add(composite);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!TryPollardRho(composite, deadlineTimestamp, out ulong factor))
|
||||
{
|
||||
pending.Add(composite);
|
||||
@@ -891,6 +886,17 @@ internal static partial class PrimeOrderCalculator
|
||||
compositeStack.Push(factor);
|
||||
compositeStack.Push(quotient);
|
||||
}
|
||||
|
||||
pollardRhoDeadlineReached = Stopwatch.GetTimestamp() > deadlineTimestamp;
|
||||
}
|
||||
|
||||
if (pollardRhoDeadlineReached)
|
||||
{
|
||||
while (compositeStack.Count > 0)
|
||||
{
|
||||
pending.Add(compositeStack.Pop());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ulong cofactor = 1UL;
|
||||
|
||||
Reference in new issue
Block a user