diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-17 17:58:20 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-02-17 17:58:20 +0700 |
commit | e3d12a2c33a7a9d0f371e1d5ff07f7ab7a3eb7ae (patch) | |
tree | a0a855afdfbfe6a4cc8a5b026f9b815ee7147d4b /crypto/src/asn1/Asn1EncodableVector.cs | |
parent | Refactoring in Cms (diff) | |
download | BouncyCastle.NET-ed25519-e3d12a2c33a7a9d0f371e1d5ff07f7ab7a3eb7ae.tar.xz |
Refactoring around Asn1EncodableVector
Diffstat (limited to 'crypto/src/asn1/Asn1EncodableVector.cs')
-rw-r--r-- | crypto/src/asn1/Asn1EncodableVector.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/src/asn1/Asn1EncodableVector.cs b/crypto/src/asn1/Asn1EncodableVector.cs index bf8d324ad..2bf1cf8e2 100644 --- a/crypto/src/asn1/Asn1EncodableVector.cs +++ b/crypto/src/asn1/Asn1EncodableVector.cs @@ -35,7 +35,7 @@ namespace Org.BouncyCastle.Asn1 public Asn1EncodableVector(int initialCapacity) { if (initialCapacity < 0) - throw new ArgumentException("must not be negative", "initialCapacity"); + throw new ArgumentException("must not be negative", nameof(initialCapacity)); this.elements = (initialCapacity == 0) ? EmptyElements : new Asn1Encodable[initialCapacity]; this.elementCount = 0; @@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Asn1 public void Add(Asn1Encodable element) { if (null == element) - throw new ArgumentNullException("element"); + throw new ArgumentNullException(nameof(element)); int capacity = elements.Length; int minCapacity = elementCount + 1; @@ -144,7 +144,7 @@ namespace Org.BouncyCastle.Asn1 public void AddAll(Asn1EncodableVector other) { if (null == other) - throw new ArgumentNullException("other"); + throw new ArgumentNullException(nameof(other)); int otherElementCount = other.Count; if (otherElementCount < 1) @@ -182,10 +182,7 @@ namespace Org.BouncyCastle.Asn1 } } - public int Count - { - get { return elementCount; } - } + public int Count => elementCount; System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { |