diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-09 15:17:26 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-09 18:21:59 +0200 |
commit | fac093e5e63bd53bae3de552fedba927bd5c4561 (patch) | |
tree | 7b921dc813a6d6e0df55ef6d15edabb76e52bd40 /xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | |
parent | 2479ab8b788ca000f2e979d0858de8d05de8e858 (diff) |
Simplify Sequence iterations in xmlscript, xmlsecurity
Use range-based loops or replace with comphelper or STL functions
Change-Id: I3d63811caf80c87a9d560087e1f0d933ebcc0d55
Reviewed-on: https://gerrit.libreoffice.org/72040
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index d67bf2e517e4..a5015bc87c55 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -142,12 +142,7 @@ OUString SAL_CALL SecurityEnvironment_NssImpl::getImplementationName() { /* XServiceInfo */ sal_Bool SAL_CALL SecurityEnvironment_NssImpl::supportsService( const OUString& serviceName) { Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; - const OUString* pArray = seqServiceNames.getConstArray() ; - for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { - if( *( pArray + i ) == serviceName ) - return true ; - } - return false ; + return comphelper::findValue(seqServiceNames, serviceName) != -1; } /* XServiceInfo */ @@ -545,9 +540,9 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, { //prepare the intermediate certificates - for (sal_Int32 i = 0; i < intermediateCerts.getLength(); i++) + for (const auto& rIntermediateCert : intermediateCerts) { - Sequence<sal_Int8> der = intermediateCerts[i]->getEncoded(); + Sequence<sal_Int8> der = rIntermediateCert->getEncoded(); SECItem item; item.type = siBuffer; item.data = reinterpret_cast<unsigned char*>(der.getArray()); @@ -559,7 +554,7 @@ verifyCertificate( const Reference< csss::XCertificate >& aCert, PR_TRUE /* copyDER */); if (!certTmp) { - SAL_INFO("xmlsecurity.xmlsec", "Failed to add a temporary certificate: " << intermediateCerts[i]->getIssuerName()); + SAL_INFO("xmlsecurity.xmlsec", "Failed to add a temporary certificate: " << rIntermediateCert->getIssuerName()); } else |