From e3d12a2c33a7a9d0f371e1d5ff07f7ab7a3eb7ae Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 17 Feb 2023 17:58:20 +0700 Subject: Refactoring around Asn1EncodableVector --- crypto/src/asn1/Asn1EncodableVector.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'crypto/src/asn1/Asn1EncodableVector.cs') 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() { -- cgit 1.4.1