diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-10-24 17:15:33 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-10-24 17:15:33 +0700 |
commit | 72692ac5cc5353ab151d1281d18ea1d9951292d7 (patch) | |
tree | 1601d953cd87e0adc7a8d7ac8f814ee8cbd40241 /crypto/src/asn1/x500/style/IetfUtilities.cs | |
parent | Refactoring around X509Name (diff) | |
download | BouncyCastle.NET-ed25519-72692ac5cc5353ab151d1281d18ea1d9951292d7.tar.xz |
Refactoring in Asn1.X500
Diffstat (limited to '')
-rw-r--r-- | crypto/src/asn1/x500/style/IetfUtilities.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/src/asn1/x500/style/IetfUtilities.cs b/crypto/src/asn1/x500/style/IetfUtilities.cs index acc1ed72e..dd2996bae 100644 --- a/crypto/src/asn1/x500/style/IetfUtilities.cs +++ b/crypto/src/asn1/x500/style/IetfUtilities.cs @@ -89,10 +89,9 @@ namespace Org.BouncyCastle.Asn1.X500.Style if (buf.Length > 0) { - int last = buf.Length - 1; - while (buf[last] == ' ' && lastEscaped != last) + while (buf[buf.Length - 1] == ' ' && lastEscaped != buf.Length - 1) { - buf.Length = last; + buf.Length = buf.Length - 1; } } @@ -107,13 +106,11 @@ namespace Org.BouncyCastle.Asn1.X500.Style private static int ConvertHex(char c) { if ('0' <= c && c <= '9') - { return c - '0'; - } + if ('a' <= c && c <= 'f') - { return c - 'a' + 10; - } + return c - 'A' + 10; } |