Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9b24cf6

Browse files
committed
Merge pull request #2060 from KrzysztofCwalina/BigIntegerOptimization
Small optimization in BigInteger
2 parents a5fc7d8 + 7087c6c commit 9b24cf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/System.Runtime.Numerics/src/System/Numerics/BigNumber.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,11 @@ private unsafe static Boolean NumberToBigInteger(ref BigNumberBuffer number, ref
432432
Int32 i = number.scale;
433433
Int32 cur = 0;
434434

435+
BigInteger ten = 10;
435436
value = 0;
436437
while (--i >= 0)
437438
{
438-
value *= 10;
439+
value *= ten;
439440
if (number.digits[cur] != '\0')
440441
{
441442
value += (Int32)(number.digits[cur++] - '0');

0 commit comments

Comments
 (0)