Skip to content

Commit 149a9d6

Browse files
committed
Fixed signature
1 parent 0a166f1 commit 149a9d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/DotNext/Numerics/Number.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ static T Sqrt(T value)
177177
/// Gets a prime number which is greater than the specified value.
178178
/// </summary>
179179
/// <typeparam name="T">The type of the value.</typeparam>
180-
/// <param name="cachedPrimes">The table with cached prime numbers sorted in ascending order.</param>
181180
/// <param name="lowerBound">The value which is smaller than the requested prime number.</param>
181+
/// <param name="cachedPrimes">The table with cached prime numbers sorted in ascending order.</param>
182182
/// <returns>The prime number which is greater than <paramref name="lowerBound"/>.</returns>
183183
/// <exception cref="OverflowException">There is no prime number that is greater than <paramref name="lowerBound"/> and less than <see cref="IMinMaxValue{T}.MaxValue"/>.</exception>
184184
[EditorBrowsable(EditorBrowsableState.Never)]
185-
public static T GetPrime<T>(ReadOnlySpan<T> cachedPrimes, T lowerBound)
185+
public static T GetPrime<T>(T lowerBound, ReadOnlySpan<T> cachedPrimes = default)
186186
where T : struct, IBinaryInteger<T>, ISignedNumber<T>, IMinMaxValue<T>
187187
{
188188
ArgumentOutOfRangeException.ThrowIfNegativeOrZero(lowerBound);

src/cluster/DotNext.Net.Cluster/Net/Cluster/Consensus/Raft/LeaderState.Context.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Context(int sizeHint)
8484
{
8585
Debug.Assert(sizeHint > 0);
8686

87-
entries = new ContextEntry?[GetPrime(Primes, sizeHint)];
87+
entries = new ContextEntry?[GetPrime(sizeHint, Primes)];
8888
}
8989

9090
private static int Grow(int size)
@@ -97,7 +97,7 @@ private static int Grow(int size)
9797
? throw new InsufficientMemoryException()
9898
: (uint)(newSize = size << 1) > maxPrimeLength && maxPrimeLength > size
9999
? maxPrimeLength
100-
: GetPrime(Primes, newSize);
100+
: GetPrime(newSize, Primes);
101101
}
102102

103103
public Context() => entries = [];

0 commit comments

Comments
 (0)