diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-07 13:05:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-07-07 15:21:33 +0200 |
commit | adf419792743a4c79b2054e42618dff75bb552ce (patch) | |
tree | 18869048ab4255831c5846709ebd522e0bd64ca3 /xmlsecurity/source/xmlsec/nss | |
parent | 23f80b26098bcf9a8ae870e8ded878cca6e0c541 (diff) |
elide some string copies
Change-Id: I3e0d9f7e5a446689e007b9d01fb1c6bf9bc068e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136880
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source/xmlsec/nss')
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx index e37a5473ceb8..1395cb2e8acb 100644 --- a/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx @@ -152,9 +152,9 @@ css::uno::Sequence< css::security::CertAltNameEntry > SAL_CALL SanExtensionImpl: OString SanExtensionImpl::removeOIDFromString( const OString &oidString) { OString objID; - OString oid("OID."); + constexpr std::string_view oid("OID."); if (oidString.match(oid)) - objID = oidString.copy(oid.getLength()); + objID = oidString.copy(oid.size()); else objID = oidString; return objID; diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx index 7e28cbc615bd..e1b62e13c0f5 100644 --- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx @@ -36,6 +36,7 @@ #include <certificateextension_xmlsecimpl.hxx> #include "sanextension_nssimpl.hxx" +#include <o3tl/string_view.hxx> #include <tools/time.hxx> #include <svl/sigstruct.hxx> @@ -185,9 +186,9 @@ css::uno::Sequence< css::uno::Reference< css::security::XCertificateExtension > // remove "OID." prefix if existing OString objID; - OString oid("OID."); + constexpr std::string_view oid("OID."); if (oidString.match(oid)) - objID = oidString.copy(oid.getLength()); + objID = oidString.copy(oid.size()); else objID = oidString; |