clang-tidy modernize-pass-by-value in formula

Change-Id: I275f96bb8b24838538ac88532508ad7dbd127eae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136271
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-06-22 09:00:52 +02:00
parent a95c585433
commit 26fbf6eef1
2 changed files with 12 additions and 10 deletions

View file

@ -33,6 +33,7 @@
#include <formula/compiler.hxx>
#include <svl/sharedstringpool.hxx>
#include <memory>
#include <utility>
namespace formula
{
@ -1933,8 +1934,8 @@ bool FormulaTypedDoubleToken::operator==( const FormulaToken& r ) const
return FormulaDoubleToken::operator==( r ) && mnType == r.GetDoubleType();
}
FormulaStringToken::FormulaStringToken( const svl::SharedString& r ) :
FormulaToken( svString ), maString( r )
FormulaStringToken::FormulaStringToken( svl::SharedString r ) :
FormulaToken( svString ), maString(std::move( r ))
{
}
@ -1961,8 +1962,8 @@ bool FormulaStringToken::operator==( const FormulaToken& r ) const
return FormulaToken::operator==( r ) && maString == r.GetString();
}
FormulaStringOpToken::FormulaStringOpToken( OpCode e, const svl::SharedString& r ) :
FormulaByteToken( e, 0, svString, ParamClass::Unknown ), maString( r ) {}
FormulaStringOpToken::FormulaStringOpToken( OpCode e, svl::SharedString r ) :
FormulaByteToken( e, 0, svString, ParamClass::Unknown ), maString(std::move( r )) {}
FormulaStringOpToken::FormulaStringOpToken( const FormulaStringOpToken& r ) :
FormulaByteToken( r ), maString( r.maString ) {}

View file

@ -24,6 +24,7 @@
#include <cstring>
#include <memory>
#include <utility>
#include <vector>
#include <formula/formuladllapi.h>
@ -336,7 +337,7 @@ class FORMULA_DLLPUBLIC FormulaStringToken final : public FormulaToken
{
svl::SharedString maString;
public:
FormulaStringToken( const svl::SharedString& r );
FormulaStringToken( svl::SharedString r );
FormulaStringToken( const FormulaStringToken& r );
virtual FormulaToken* Clone() const override;
@ -352,7 +353,7 @@ class FORMULA_DLLPUBLIC FormulaStringOpToken final : public FormulaByteToken
{
svl::SharedString maString;
public:
FormulaStringOpToken( OpCode e, const svl::SharedString& r );
FormulaStringOpToken( OpCode e, svl::SharedString r );
FormulaStringOpToken( const FormulaStringOpToken& r );
virtual FormulaToken* Clone() const override;
@ -386,12 +387,12 @@ class FORMULA_DLLPUBLIC FormulaExternalToken final : public FormulaByteToken
private:
OUString aExternal;
public:
FormulaExternalToken( OpCode e, sal_uInt8 n, const OUString& r ) :
FormulaExternalToken( OpCode e, sal_uInt8 n, OUString r ) :
FormulaByteToken( e, n, svExternal, ParamClass::Unknown ),
aExternal( r ) {}
FormulaExternalToken( OpCode e, const OUString& r ) :
aExternal(std::move( r )) {}
FormulaExternalToken( OpCode e, OUString r ) :
FormulaByteToken( e, 0, svExternal, ParamClass::Unknown ),
aExternal( r ) {}
aExternal(std::move( r )) {}
FormulaExternalToken( const FormulaExternalToken& r ) :
FormulaByteToken( r ), aExternal( r.aExternal ) {}