From eb89e9957f34982f75f36ef237166ccbc2042768 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 14 Jul 2023 14:32:40 +0700 Subject: Refactor using MapElements --- crypto/src/ocsp/RespData.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'crypto/src/ocsp/RespData.cs') diff --git a/crypto/src/ocsp/RespData.cs b/crypto/src/ocsp/RespData.cs index 00de1cd59..e132c45b1 100644 --- a/crypto/src/ocsp/RespData.cs +++ b/crypto/src/ocsp/RespData.cs @@ -33,20 +33,12 @@ namespace Org.BouncyCastle.Ocsp get { return data.ProducedAt.ToDateTime(); } } - public SingleResp[] GetResponses() - { - Asn1Sequence s = data.Responses; - SingleResp[] rs = new SingleResp[s.Count]; - - for (int i = 0; i != rs.Length; i++) - { - rs[i] = new SingleResp(SingleResponse.GetInstance(s[i])); - } - - return rs; - } + public SingleResp[] GetResponses() + { + return data.Responses.MapElements(element => new SingleResp(SingleResponse.GetInstance(element))); + } - public X509Extensions ResponseExtensions + public X509Extensions ResponseExtensions { get { return data.ResponseExtensions; } } -- cgit 1.4.1