diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-27 10:25:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-27 12:55:23 +0200 |
commit | d203d3aeb29a46bd85eb320d4ebcd7325ec4a1ab (patch) | |
tree | ab5359c7c3361dbaa2fd474cb4c5a7e313c5f7e0 /sax | |
parent | ba8502545fb5519a5cd13a673ee72d82f0fd8852 (diff) |
clang-tidy modernize-pass-by-value in sax
Change-Id: I0357c7e3f5ae1d0a560057ac756b1118917a5e11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135038
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 8 | ||||
-rw-r--r-- | sax/source/fastparser/legacyfastparser.cxx | 3 | ||||
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 9 |
3 files changed, 12 insertions, 8 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 47f3da4a2ba6..250078bc5054 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -19,6 +19,7 @@ #include <sax/fastparser.hxx> #include <sax/fastattribs.hxx> +#include <utility> #include <xml2utf.hxx> #include <com/sun/star/io/XSeekable.hpp> @@ -98,8 +99,8 @@ struct NameWithToken OUString msName; sal_Int32 mnToken; - NameWithToken(const OUString& sName, sal_Int32 nToken) : - msName(sName), mnToken(nToken) {} + NameWithToken(OUString sName, sal_Int32 nToken) : + msName(std::move(sName)), mnToken(nToken) {} }; struct SaxContext @@ -136,7 +137,8 @@ struct NamespaceDefine sal_Int32 mnToken; OUString maNamespaceURL; - NamespaceDefine( const OString& rPrefix, sal_Int32 nToken, const OUString& rNamespaceURL ) : maPrefix( rPrefix ), mnToken( nToken ), maNamespaceURL( rNamespaceURL ) {} + NamespaceDefine( OString aPrefix, sal_Int32 nToken, OUString aNamespaceURL ) + : maPrefix(std::move( aPrefix )), mnToken( nToken ), maNamespaceURL(std::move( aNamespaceURL )) {} NamespaceDefine() : mnToken(-1) {} }; diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx index d32b12d8a5f9..e4c425bd07d3 100644 --- a/sax/source/fastparser/legacyfastparser.cxx +++ b/sax/source/fastparser/legacyfastparser.cxx @@ -27,6 +27,7 @@ #include <comphelper/processfactory.hxx> #include <rtl/ref.hxx> #include <memory> +#include <utility> #include <vector> using namespace ::cppu; @@ -46,7 +47,7 @@ private: OUString m_aPrefix; OUString m_aNamespaceURI; - NamespaceDefine( const OUString& rPrefix, const OUString& rNamespaceURI ) : m_aPrefix( rPrefix ), m_aNamespaceURI( rNamespaceURI ) {} + NamespaceDefine( OUString aPrefix, OUString aNamespaceURI ) : m_aPrefix(std::move( aPrefix )), m_aNamespaceURI(std::move( aNamespaceURI )) {} }; std::vector< std::unique_ptr< NamespaceDefine > > m_aNamespaceDefines; diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 1af7821cba24..9b309d5fb422 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/xml/sax/SAXException.hpp> #include <rtl/math.h> #include <sax/fastattribs.hxx> +#include <utility> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml; @@ -34,13 +35,13 @@ FastTokenHandlerBase::~FastTokenHandlerBase() { } -UnknownAttribute::UnknownAttribute( const OUString& rNamespaceURL, const OString& rName, const OString& value ) - : maNamespaceURL( rNamespaceURL ), maName( rName ), maValue( value ) +UnknownAttribute::UnknownAttribute( OUString aNamespaceURL, OString aName, OString value ) + : maNamespaceURL(std::move( aNamespaceURL )), maName(std::move( aName )), maValue(std::move( value )) { } -UnknownAttribute::UnknownAttribute( const OString& rName, const OString& value ) - : maName( rName ), maValue( value ) +UnknownAttribute::UnknownAttribute( OString aName, OString value ) + : maName(std::move( aName )), maValue(std::move( value )) { } |