From efcf4e1fbcd1f1237d7f40567e3b2416daa7cd17 Mon Sep 17 00:00:00 2001 From: kzrnm Date: Wed, 5 Feb 2025 19:57:44 +0900 Subject: [PATCH] Fix '< StackAllocThreshold' to '<= StackAllocThreshold' --- .../System.Runtime.Numerics/src/System/Number.BigInteger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs b/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs index beafaa7a0f646f..7b8cad45d7107a 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs @@ -786,7 +786,7 @@ internal static bool TryFormatBigInteger(BigInteger value, ReadOnlySpan fo int base1E9BufferLength = (int)(value._bits.Length * digitRatio) + 1; uint[]? base1E9BufferFromPool = null; - Span base1E9Buffer = base1E9BufferLength < BigIntegerCalculator.StackAllocThreshold ? + Span base1E9Buffer = base1E9BufferLength <= BigIntegerCalculator.StackAllocThreshold ? stackalloc uint[base1E9BufferLength] : (base1E9BufferFromPool = ArrayPool.Shared.Rent(base1E9BufferLength)); base1E9Buffer.Clear();