Reapply modulo helpers and inline fast remainders
This commit is contained in:
1 parent
5db0c4fa95
commit
ca866ffc5b
43 files changed
+982
-134
No files matched your search
@@ -100,14 +100,14 @@ public static class PrimesGenerator
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static bool IsAllowedForLastOne(uint prime)
|
||||
{
|
||||
uint mod10 = prime % 10U;
|
||||
uint mod10 = prime % 10U;
|
||||
return mod10 == 1U || mod10 == 3U || mod10 == 9U || prime == 7U || prime == 11U;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static bool IsAllowedForLastSeven(uint prime)
|
||||
{
|
||||
uint mod10 = prime % 10U;
|
||||
uint mod10 = prime % 10U;
|
||||
return mod10 == 3U || mod10 == 7U || mod10 == 9U || prime == 11U;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user