summary refs log tree commit diff
path: root/crypto/src/asn1/x509/TargetInformation.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/x509/TargetInformation.cs')
-rw-r--r--crypto/src/asn1/x509/TargetInformation.cs21
1 files changed, 7 insertions, 14 deletions
diff --git a/crypto/src/asn1/x509/TargetInformation.cs b/crypto/src/asn1/x509/TargetInformation.cs
index 2bf218977..c51e1e891 100644
--- a/crypto/src/asn1/x509/TargetInformation.cs
+++ b/crypto/src/asn1/x509/TargetInformation.cs
@@ -56,32 +56,25 @@ namespace Org.BouncyCastle.Asn1.X509
 			this.targets = targets;
 		}
 
-		/**
+        /**
 		 * Returns the targets in this target information extension.
 		 * <p>
 		 * The ArrayList is cloned before it is returned.</p>
 		 * 
 		 * @return Returns the targets.
 		 */
-		public virtual Targets[] GetTargetsObjects()
-		{
-			Targets[] result = new Targets[targets.Count];
-
-			for (int i = 0; i < targets.Count; ++i)
-			{
-				result[i] = Targets.GetInstance(targets[i]);
-			}
+        public virtual Targets[] GetTargetsObjects()
+        {
+            return targets.MapElements(Targets.GetInstance);
+        }
 
-			return result;
-		}
-
-		/**
+        /**
 		 * Constructs a target information from a single targets element. 
 		 * According to RFC 3281 only one targets element must be produced.
 		 * 
 		 * @param targets A Targets instance.
 		 */
-		public TargetInformation(
+        public TargetInformation(
 			Targets targets)
 		{
 			this.targets = new DerSequence(targets);