summary refs log tree commit diff
path: root/crypto/src/asn1/x509/Targets.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x509/Targets.cs')
-rw-r--r--crypto/src/asn1/x509/Targets.cs21
1 files changed, 7 insertions, 14 deletions
diff --git a/crypto/src/asn1/x509/Targets.cs b/crypto/src/asn1/x509/Targets.cs
index 0387e1f6b..93af8006d 100644
--- a/crypto/src/asn1/x509/Targets.cs
+++ b/crypto/src/asn1/x509/Targets.cs
@@ -85,26 +85,19 @@ namespace Org.BouncyCastle.Asn1.X509
 			this.targets = new DerSequence(targets);
 		}
 
-		/**
+        /**
 		 * Returns the targets in an <code>ArrayList</code>.
 		 * <p>
 		 * The ArrayList is cloned before it is returned.</p>
 		 * 
 		 * @return Returns the targets.
 		 */
-		public virtual Target[] GetTargets()
-		{
-			Target[] result = new Target[targets.Count];
-
-			for (int i = 0; i < targets.Count; ++i)
-			{
-				result[i] = Target.GetInstance(targets[i]);
-			}
-
-			return result;
-		}
+        public virtual Target[] GetTargets()
+        {
+            return targets.MapElements(Target.GetInstance);
+        }
 
-		/**
+        /**
 		 * Produce an object suitable for an Asn1OutputStream.
 		 * 
 		 * Returns:
@@ -115,7 +108,7 @@ namespace Org.BouncyCastle.Asn1.X509
 		 * 
 		 * @return an Asn1Object
 		 */
-		public override Asn1Object ToAsn1Object()
+        public override Asn1Object ToAsn1Object()
 		{
 			return targets;
 		}