Skip to content

Commit 60045c2

Browse files
kzrnmtmds
authored andcommitted
#if DEBUG private static #else private const (dotnet#96538)
1 parent e5a6a14 commit 60045c2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/libraries/System.Runtime.Numerics/src/System/Number.BigInteger.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,13 @@ internal static ParsingStatus TryParseBigIntegerBinaryNumberStyle(ReadOnlySpan<c
657657
// algorithm with a running time of O(N^2). And if it is greater than the threshold, use
658658
// a divide-and-conquer algorithm with a running time of O(NlogN).
659659
//
660-
private static int s_naiveThreshold = 20000; // non-readonly for testing
660+
#if DEBUG
661+
// Mutable for unit testing...
662+
private static
663+
#else
664+
private const
665+
#endif
666+
int s_naiveThreshold = 20000;
661667
private static ParsingStatus NumberToBigInteger(ref NumberBuffer number, out BigInteger result)
662668
{
663669
int currentBufferSize = 0;

0 commit comments

Comments
 (0)