summary refs log tree commit diff
path: root/crypto/src/asn1/Asn1Set.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-03-07 16:03:07 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-03-07 16:03:07 +0700
commite47f41dbe4e61cb190154693b72bc99eb6ca6c3e (patch)
treed92fd90fc444d6141745c8ae0d60838f92502e06 /crypto/src/asn1/Asn1Set.cs
parentAdd BasicGcmMultiplier.IsHardwareAccelerated (diff)
downloadBouncyCastle.NET-ed25519-e47f41dbe4e61cb190154693b72bc99eb6ca6c3e.tar.xz
Remove lazy ASN.1 behaviour
Diffstat (limited to 'crypto/src/asn1/Asn1Set.cs')
-rw-r--r--crypto/src/asn1/Asn1Set.cs7
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/src/asn1/Asn1Set.cs b/crypto/src/asn1/Asn1Set.cs
index 222a6c727..514c8c77c 100644
--- a/crypto/src/asn1/Asn1Set.cs
+++ b/crypto/src/asn1/Asn1Set.cs
@@ -77,9 +77,8 @@ namespace Org.BouncyCastle.Asn1
             return (Asn1Set)Meta.Instance.GetContextInstance(taggedObject, declaredExplicit);
         }
 
-        // NOTE: Only non-readonly to support LazyDLSet
-        internal Asn1Encodable[] m_elements;
         internal Asn1Encodable[] m_sortedElements;
+        internal readonly Asn1Encodable[] m_elements;
 
         protected internal Asn1Set()
         {
@@ -167,7 +166,6 @@ namespace Org.BouncyCastle.Asn1
 
         public virtual T[] MapElements<T>(Func<Asn1Encodable, T> func)
         {
-            // NOTE: Call Count here to 'force' a LazyDerSet
             int count = Count;
             T[] result = new T[count];
             for (int i = 0; i < count; ++i)
@@ -193,7 +191,6 @@ namespace Org.BouncyCastle.Asn1
                 Asn1Set outer)
             {
                 this.outer = outer;
-                // NOTE: Call Count here to 'force' a LazyDerSet
                 this.max = outer.Count;
             }
 
@@ -229,7 +226,6 @@ namespace Org.BouncyCastle.Asn1
 
         protected override int Asn1GetHashCode()
         {
-            // NOTE: Call Count here to 'force' a LazyDerSet
             int i = Count;
             int hc = i + 1;
 
@@ -247,7 +243,6 @@ namespace Org.BouncyCastle.Asn1
             if (!(asn1Object is Asn1Set that))
                 return false;
 
-            // NOTE: Call Count here (on both) to 'force' a LazyDerSet
             int count = this.Count;
             if (that.Count != count)
                 return false;