Skip to content

Commit d141af8

Browse files
committed
Let FastMod return ulong for perf
1 parent 238366a commit d141af8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Src/FastData/Generators/Helpers/MathHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static class MathHelper
2929
/// <param name="multiplier">The precomputed multiplier.</param>
3030
/// <returns>The result of value mod divisor.</returns>
3131
[MethodImpl(MethodImplOptions.AggressiveInlining)]
32-
public static uint FastMod(uint value, uint divisor, ulong multiplier) => unchecked((uint)(((((multiplier * value) >> 32) + 1) * divisor) >> 32));
32+
public static ulong FastMod(uint value, uint divisor, ulong multiplier) => unchecked(((((multiplier * value) >> 32) + 1) * divisor) >> 32);
3333

3434
/// <summary>Determines whether the specified value is a power of two.</summary>
3535
/// <param name="x">The value to check.</param>

Src/FastData/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static Genbox.FastData.Generators.EarlyExits.MinMaxValueEarlyExit<T>.operator !=
169169
static Genbox.FastData.Generators.EarlyExits.MinMaxValueEarlyExit<T>.operator ==(Genbox.FastData.Generators.EarlyExits.MinMaxValueEarlyExit<T>? left, Genbox.FastData.Generators.EarlyExits.MinMaxValueEarlyExit<T>? right) -> bool
170170
static Genbox.FastData.Generators.Extensions.DataTypeExtensions.IsIdentityHash(this Genbox.FastData.Enums.DataType type) -> bool
171171
static Genbox.FastData.Generators.Extensions.DataTypeExtensions.IsInteger(this Genbox.FastData.Enums.DataType type) -> bool
172-
static Genbox.FastData.Generators.Helpers.MathHelper.FastMod(uint value, uint divisor, ulong multiplier) -> uint
172+
static Genbox.FastData.Generators.Helpers.MathHelper.FastMod(uint value, uint divisor, ulong multiplier) -> ulong
173173
static Genbox.FastData.Generators.Helpers.MathHelper.GetFastModMultiplier(uint divisor) -> ulong
174174
static Genbox.FastData.Generators.Helpers.MathHelper.GetPrime(uint min) -> uint
175175
static Genbox.FastData.Generators.Helpers.MathHelper.IsPowerOfTwo(ulong x) -> bool

0 commit comments

Comments
 (0)