diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-27 20:00:46 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-27 20:00:46 +0700 |
commit | ca24841d2e00c51a0a52df522139fcb096e0995f (patch) | |
tree | ea5d86bd2127a80ecc64a0b44f8b114f67291aef /crypto/src/math | |
parent | Bcpg: update signature subpackets (diff) | |
download | BouncyCastle.NET-ed25519-ca24841d2e00c51a0a52df522139fcb096e0995f.tar.xz |
Use string.Create when available
Diffstat (limited to 'crypto/src/math')
-rw-r--r-- | crypto/src/math/ec/abc/SimpleBigDecimal.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/src/math/ec/abc/SimpleBigDecimal.cs b/crypto/src/math/ec/abc/SimpleBigDecimal.cs index d5664dbfd..c69d02f0c 100644 --- a/crypto/src/math/ec/abc/SimpleBigDecimal.cs +++ b/crypto/src/math/ec/abc/SimpleBigDecimal.cs @@ -196,19 +196,18 @@ namespace Org.BouncyCastle.Math.EC.Abc } string leftOfPoint = floorBigInt.ToString(); - char[] fractCharArr = new char[scale]; - string fractStr = fract.ToString(2); + char[] rightOfPoint = new char[scale]; + string fractStr = fract.ToString(2); int fractLen = fractStr.Length; int zeroes = scale - fractLen; for (int i = 0; i < zeroes; i++) { - fractCharArr[i] = '0'; + rightOfPoint[i] = '0'; } for (int j = 0; j < fractLen; j++) { - fractCharArr[zeroes + j] = fractStr[j]; + rightOfPoint[zeroes + j] = fractStr[j]; } - string rightOfPoint = new string(fractCharArr); StringBuilder sb = new StringBuilder(leftOfPoint); sb.Append("."); |