connectivity/source/commontools/RowFunctionParser.cxx  |    2 +-
 connectivity/source/drivers/calc/CDatabaseMetaData.cxx |    4 ++--
 connectivity/source/drivers/file/FStatement.cxx        |    2 +-
 connectivity/source/parse/sqlnode.cxx                  |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f2fc901be9252329fc4b2dac83475146830f13db
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Nov 8 12:37:07 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Nov 11 10:58:45 2024 +0100

    clang-tidy: performance-unnecessary-copy-initialization in connectivity
    
    Change-Id: Ibb485324c71b78ff569cb15b6cf6f7f3889e1dc6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176376
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/connectivity/source/commontools/RowFunctionParser.cxx 
b/connectivity/source/commontools/RowFunctionParser.cxx
index 0a1ee2ce4af4..51c75a44dc1c 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -412,7 +412,7 @@ std::shared_ptr<ExpressionNode> const & 
FunctionParser::parseFunction( const OUS
 
     // static parser context, because the actual
     // Spirit parser is also a static object
-    ParserContextSharedPtr pContext = getParserContext();
+    const ParserContextSharedPtr& pContext = getParserContext();
 
     ExpressionGrammar aExpressionGrammer( pContext );
 
diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx 
b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
index 6d77b8c4b2f3..4c642e66f2e7 100644
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
@@ -167,7 +167,7 @@ Reference< XResultSet > SAL_CALL 
OCalcDatabaseMetaData::getTables(
     sal_Int32 nSheetCount = aSheetNames.getLength();
     for (sal_Int32 nSheet=0; nSheet<nSheetCount; nSheet++)
     {
-        OUString aName = aSheetNames[nSheet];
+        const OUString& aName = aSheetNames[nSheet];
         if ( !lcl_IsEmptyOrHidden( xSheets, aName ) && 
match(tableNamePattern,aName,'
         {
             aRows.push_back( { nullptr, nullptr, nullptr,
@@ -191,7 +191,7 @@ Reference< XResultSet > SAL_CALL 
OCalcDatabaseMetaData::getTables(
             sal_Int32 nDBCount = aDBNames.getLength();
             for (sal_Int32 nRange=0; nRange<nDBCount; nRange++)
             {
-                OUString aName = aDBNames[nRange];
+                const OUString& aName = aDBNames[nRange];
                 if ( !lcl_IsUnnamed( xRanges, aName ) && 
match(tableNamePattern,aName,'
                 {
                     aRows.push_back( { nullptr, nullptr, nullptr,
diff --git a/connectivity/source/drivers/file/FStatement.cxx 
b/connectivity/source/drivers/file/FStatement.cxx
index 931b13961f02..fca2c963eb33 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -610,7 +610,7 @@ void OStatement_Base::GetAssignValues()
 void OStatement_Base::ParseAssignValues(const std::vector< OUString>& 
aColumnNameList,OSQLParseNode* pRow_Value_Constructor_Elem, sal_Int32 nIndex)
 {
     OSL_ENSURE(o3tl::make_unsigned(nIndex) <= 
aColumnNameList.size(),"SdbFileCursor::ParseAssignValues: nIndex > 
aColumnNameList.GetTokenCount()");
-    OUString aColumnName(aColumnNameList[nIndex]);
+    const OUString& aColumnName(aColumnNameList[nIndex]);
     OSL_ENSURE(aColumnName.getLength() > 0,"OResultSet: Column-Name not 
found");
     assert(pRow_Value_Constructor_Elem != nullptr && "OResultSet: 
pRow_Value_Constructor_Elem must not be NULL!");
 
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index edef27ab6975..95d6e88c2215 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -729,7 +729,7 @@ void OSQLParseNode::impl_parseLikeNodeToString_throw( 
OUStringBuffer& rString, c
     const OSQLParseNode* pEscNode = nullptr;
     const OSQLParseNode* pParaNode = nullptr;
 
-    SQLParseNodeParameter aNewParam(rParam);
+    const SQLParseNodeParameter& aNewParam(rParam);
     //aNewParam.bQuote = sal_True; // why setting this to true? @see 
https://bz.apache.org/ooo/show_bug.cgi?id=75557
 
     if ( !(bSimple && rParam.bPredicate && rParam.xField.is() && 
SQL_ISRULE(m_aChildren[0],column_ref) && columnMatchP(m_aChildren[0].get(), 
rParam)) )

Reply via email to