From b2865b54ceb569bf6cde2e75453b0157ab5633b1 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Wed, 29 Oct 2025 14:04:25 +0100 Subject: [PATCH] Tiny optimization --- PerfectNumbers.Core/HeuristicCombinedPrimeTester.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/PerfectNumbers.Core/HeuristicCombinedPrimeTester.cs b/PerfectNumbers.Core/HeuristicCombinedPrimeTester.cs index b9ec773..6175a28 100644 --- a/PerfectNumbers.Core/HeuristicCombinedPrimeTester.cs +++ b/PerfectNumbers.Core/HeuristicCombinedPrimeTester.cs @@ -180,7 +180,7 @@ public sealed class HeuristicCombinedPrimeTester private static bool HeuristicTrialDivisionGpuDetectsDivisor(ulong n, ulong sqrtLimit, byte nMod10) { - int batchCapacity = Math.Max(1, HeuristicGpuDivisorBatchSize); + int batchCapacity = HeuristicGpuDivisorBatchSize; var divisorPool = ThreadStaticPools.UlongPool; var hitPool = ThreadStaticPools.BytePool; @@ -201,11 +201,6 @@ public sealed class HeuristicCombinedPrimeTester bool ProcessBatch(int length) { - if (length <= 0) - { - return false; - } - input.View.CopyFromCPU(ref divisorArray[0], length); state.HeuristicTrialDivisionKernel(length, input.View, n, output.View); accelerator.Synchronize();