Inline single-use modulo helpers

This commit is contained in:
Marek Lemańczyk committed 2025-09-22 19:54:54 +02:00
1 parent 3598f88aaf
commit 3b8a10a20b
5 files changed
+33 -35

No files matched your search

+2 -3
View File
@@ -221,8 +221,7 @@ public static class ULongExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong Mod6(this ulong value)
{
ulong key = (value.Mod3() << 1) | (value & 1UL);
return Mod6Lookup[(int)key];
return Mod6Lookup[(int)(((value.Mod3() << 1) | (value & 1UL)))];
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -647,4 +646,4 @@ public static class ULongExtensions
return false;
}
}
}