From af65e892dcf729a4b65198379d2155163460bf5e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 Jul 2022 09:49:47 +0200 Subject: [PATCH] clang-tidy modernize-pass-by-value in xmlreader Change-Id: I448d3119129a864e79dbef336e46545f9aca8b25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137584 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/xmlreader/xmlreader.hxx | 2 +- xmlreader/source/xmlreader.cxx | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/xmlreader/xmlreader.hxx b/include/xmlreader/xmlreader.hxx index e55e5d2cadd4..b85e4e602060 100644 --- a/include/xmlreader/xmlreader.hxx +++ b/include/xmlreader/xmlreader.hxx @@ -35,7 +35,7 @@ namespace xmlreader { class OOO_DLLPUBLIC_XMLREADER XmlReader { public: - explicit XmlReader(OUString const & fileUrl); + explicit XmlReader(OUString fileUrl); ~XmlReader(); diff --git a/xmlreader/source/xmlreader.cxx b/xmlreader/source/xmlreader.cxx index 5153db2fb1c3..00489caa4987 100644 --- a/xmlreader/source/xmlreader.cxx +++ b/xmlreader/source/xmlreader.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -52,8 +53,8 @@ bool isSpace(char c) { } -XmlReader::XmlReader(OUString const & fileUrl) - : fileUrl_(fileUrl) +XmlReader::XmlReader(OUString fileUrl) + : fileUrl_(std::move(fileUrl)) , fileHandle_(nullptr) { oslFileError e = osl_openFile(