sal/cppunittester/cppunittester.cxx | 5 +++-- sal/osl/unx/file_path_helper.cxx | 5 +++-- sal/rtl/bootstrap.cxx | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-)
New commits: commit 4e2f5e85c9c22e57e01d6fa6f585f91287efc7ef Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 17 13:52:14 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 17 17:36:16 2022 +0200 clang-tidy modernize-pass-by-value in sal Change-Id: If05c5cf0e333d0dbba31475af69c517486bf8923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index e726ac3f8273..81ddec1568ed 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -69,6 +69,7 @@ #include <algorithm> #include <string_view> +#include <utility> namespace { @@ -188,8 +189,8 @@ private: struct test_name_compare { - explicit test_name_compare(const std::string& rName): - maName(rName) + explicit test_name_compare(std::string aName): + maName(std::move(aName)) { } diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 080a99c09928..a8ee5238f95a 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <utility> #include "file_path_helper.hxx" #include "uunxapi.hxx" @@ -170,8 +171,8 @@ public: returns the first path in list, no need to call reset first */ - path_list_iterator(const OUString& path_list, sal_Unicode list_separator = FPH_CHAR_COLON) : - m_path_list(path_list), + path_list_iterator(OUString path_list, sal_Unicode list_separator = FPH_CHAR_COLON) : + m_path_list(std::move(path_list)), m_end(m_path_list.getStr() + m_path_list.getLength() + 1), m_separator(list_separator) { diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 68e219406cc4..12558d319e44 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -39,6 +39,7 @@ #include <o3tl/lru_map.hxx> #include <o3tl/string_view.hxx> +#include <utility> #include <vector> #include <algorithm> #include <cstddef> @@ -121,9 +122,9 @@ struct rtl_bootstrap_NameValue rtl_bootstrap_NameValue() {} - rtl_bootstrap_NameValue(OUString const & name, OUString const & value ) - : sName( name ), - sValue( value ) + rtl_bootstrap_NameValue(OUString name, OUString value ) + : sName(std::move( name )), + sValue(std::move( value )) {} };