Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes.
This commit is contained in:
1 parent
cd7636ddbe
commit
a84445ef2a
15 files changed
+67
-73
No files matched your search
@@ -898,7 +898,7 @@ public class MersenneDivisorCycles
|
||||
start = end + 1UL;
|
||||
}
|
||||
|
||||
AcceleratorStreamPool.Return(acceleratorIndex, stream);
|
||||
AcceleratorStreamPool.Return(acceleratorIndex);
|
||||
pool.Return(divisors, clearArray: false);
|
||||
pool.Return(outCycles, clearArray: false);
|
||||
|
||||
@@ -907,7 +907,7 @@ public class MersenneDivisorCycles
|
||||
|
||||
private static Kernel GetDivisorCycleKernel(int acceleratorIndex)
|
||||
{
|
||||
var pool = _divisorCycleKernel ??= [];
|
||||
var pool = _divisorCycleKernel ??= new Kernel[PerfectNumberConstants.RollingAccelerators];
|
||||
if (pool[acceleratorIndex] is {} cached)
|
||||
{
|
||||
return cached;
|
||||
|
||||
Reference in new issue
Block a user