Pools made thread static. Various small optimizations. "in" parameter added to read-only method parameters
This commit is contained in:
1 parent
7c71d5165e
commit
d3695a3dc3
10 files changed
+1713
-1775
No files matched your search
@@ -38,8 +38,8 @@ namespace PerfectNumbers.Core
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static readonly PartialFactorResult Empty = new PartialFactorResult
|
||||
{
|
||||
public static readonly PartialFactorResult Empty = new()
|
||||
{
|
||||
Cofactor = 1UL,
|
||||
FullyFactored = true,
|
||||
};
|
||||
@@ -70,7 +70,7 @@ namespace PerfectNumbers.Core
|
||||
if (factors is not null)
|
||||
{
|
||||
Factors = null;
|
||||
ArrayPool<FactorEntry>.Shared.Return(factors, clearArray: false);
|
||||
ThreadStaticPools.FactorEntryPool.Return(factors, clearArray: false);
|
||||
}
|
||||
|
||||
_next = s_poolHead;
|
||||
|
||||
Reference in new issue
Block a user