Clear heuristic candidate list without try-finally
This commit is contained in:
1 parent
51730bcba3
commit
0a23502441
1 file changed
+2
-6
@@ -407,13 +407,12 @@ internal static partial class PrimeOrderCalculator
|
||||
|
||||
int capacity = config.MaxPowChecks <= 0 ? 64 : config.MaxPowChecks * 4;
|
||||
List<ulong> candidates = AcquireHeuristicCandidateList(capacity);
|
||||
try
|
||||
{
|
||||
FactorEntry[] factorArray = orderFactors.Factors!;
|
||||
// DebugLog("Building candidates list");
|
||||
BuildCandidates(order, factorArray, orderFactors.Count, candidates, capacity);
|
||||
if (candidates.Count == 0)
|
||||
{
|
||||
candidates.Clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -514,6 +513,7 @@ internal static partial class PrimeOrderCalculator
|
||||
pool.Return(gpuPool, clearArray: false);
|
||||
}
|
||||
|
||||
candidates.Clear();
|
||||
result = candidate;
|
||||
return true;
|
||||
}
|
||||
@@ -526,11 +526,7 @@ internal static partial class PrimeOrderCalculator
|
||||
index += batchSize;
|
||||
}
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
candidates.Clear();
|
||||
}
|
||||
// DebugLog("No candidate confirmed");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user