MethodImplOptions.AggressiveOptimization & MethodImplOptions.AggressiveInlining optimized. Small optimizations.
This commit is contained in:
1 parent
7a242b3bfa
commit
05d3061c47
23 files changed
+628
-559
No files matched your search
@@ -7,7 +7,7 @@ public struct AscendingDivisorRemainderStepper
|
||||
private readonly ulong _dividend;
|
||||
private ulong _maxDivisor;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.AggressiveInlining)]
|
||||
public AscendingDivisorRemainderStepper(ulong value)
|
||||
{
|
||||
_dividend = value;
|
||||
@@ -20,10 +20,10 @@ public struct AscendingDivisorRemainderStepper
|
||||
_maxDivisor = root;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public readonly bool ShouldContinue(ulong divisor) => divisor <= _maxDivisor;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public bool Divides(ulong divisor)
|
||||
{
|
||||
ulong remainder = _dividend;
|
||||
|
||||
Reference in new issue
Block a user