Quellcode durchsuchen

HPCC-27333 Fix some missing references on temporary variables

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday vor 3 Jahren
Ursprung
Commit
422d766565

+ 1 - 1
dali/ft/fttransform.cpp

@@ -827,7 +827,7 @@ processedProgress:
             }
 
             const RemoteFilename & outputFilename = curPartition.outputName;
-            auto fsProperties = outputFilename.queryFileSystemProperties();
+            const auto & fsProperties = outputFilename.queryFileSystemProperties();
             RemoteFilename localTempFilename;
             if (!fsProperties.canRename)
                 localTempFilename.set(outputFilename);

+ 3 - 3
esp/services/ws_sql/SQL2ECL/ECLEngine.cpp

@@ -204,7 +204,7 @@ void ECLEngine::generateSelectECL(HPCCSQLTreeWalker * selectsqlobj, StringBuffer
 
     ForEachItemIn(tableidx, *tables)
     {
-        SQLTable table = tables->item(tableidx);
+        SQLTable & table = tables->item(tableidx);
         const char * tname = table.getName();
 
         HPCCFilePtr file = selectsqlobj->queryHPCCFileCache()->getHpccFileByName(tname);
@@ -710,7 +710,7 @@ bool ECLEngine::processIndex(HPCCFile * indexfiletouse, StringBuffer & keyedandw
     {
         for (int indexfilecolumnindex = 0; indexfilecolumnindex < indexfilecolumns->length(); indexfilecolumnindex++)
         {
-            HPCCColumnMetaData currcol = indexfilecolumns->item(indexfilecolumnindex);
+            HPCCColumnMetaData & currcol = indexfilecolumns->item(indexfilecolumnindex);
             const char * currindexfilecolname = currcol.getColumnName();
             if (currcol.isKeyedField())
             {
@@ -927,7 +927,7 @@ bool ECLEngine::appendTranslatedHavingClause(HPCCSQLTreeWalker * sqlobj, StringB
             const IArrayOf<SQLTable> * tables = sqlobj->getTableList();
             ForEachItemIn(tableidx, *tables)
             {
-                SQLTable table = tables->item(tableidx);
+                SQLTable & table = tables->item(tableidx);
                 translator->appendProp(table.getName(), "LEFT");
             }
 

+ 2 - 2
esp/services/ws_sql/SQL2ECL/HPCCFile.cpp

@@ -234,7 +234,7 @@ void HPCCFile::getFieldsAsDelmitedString(char delim, const char * prefix, String
     bool isFirst = true;
     ForEachItemIn(colidx, columns)
     {
-        HPCCColumnMetaData currcol = columns.item(colidx);
+        HPCCColumnMetaData & currcol = columns.item(colidx);
         if ((onlykeyed && currcol.isKeyedField()) || (!onlykeyed && !currcol.isKeyedField()))
         {
             if (!isFirst)
@@ -276,7 +276,7 @@ void HPCCFile::setKeyCounts()
     keyedCount = 0;
     ForEachItemIn(colidx, columns)
     {
-        HPCCColumnMetaData currcol = columns.item(colidx);
+        HPCCColumnMetaData & currcol = columns.item(colidx);
         if (!currcol.isKeyedField())
             nonKeyedCount++;
         else

+ 1 - 1
esp/services/ws_sql/SQL2ECL/HPCCFileCache.cpp

@@ -110,7 +110,7 @@ bool HPCCFileCache::fetchHpccFilesByTableName(IArrayOf<SQLTable> * sqltables)
 
     ForEachItemIn(tableindex, *sqltables)
     {
-       SQLTable table = sqltables->item(tableindex);
+       SQLTable & table = sqltables->item(tableindex);
        const char * cachedKey = cacheHpccFileByName(table.getName());
        allFound &= (cachedKey && *cachedKey);
     }

+ 3 - 3
esp/services/ws_sql/SQL2ECL/HPCCSQLTreeWalker.cpp

@@ -1201,7 +1201,7 @@ void HPCCSQLTreeWalker::expandWildCardColumn()
             {
                 ForEachItemIn(tableidx, tableList)
                 {
-                    SQLTable tab = (SQLTable)tableList.item(tableidx);
+                    SQLTable & tab = tableList.item(tableidx);
 
                     HPCCFilePtr file = tmpHPCCFileCache->getHpccFileByName(tab.getName());
                     if (file)
@@ -1233,7 +1233,7 @@ void HPCCSQLTreeWalker::expandWildCardColumn()
                     IArrayOf<HPCCColumnMetaData> * cols = file->getColumns();
                     ForEachItemIn(colidx, *cols)
                     {
-                        HPCCColumnMetaData col = cols->item(colidx);
+                        HPCCColumnMetaData & col = cols->item(colidx);
                         Owned<ISQLExpression> fve = new SQLFieldValueExpression(tablename, col.getColumnName());
                         if (colidx == 0)
                         {
@@ -1431,7 +1431,7 @@ bool HPCCSQLTreeWalker::normalizeSQL()
                     if (idxt > 0)
                         normalizedSQL.append(", ");
 
-                    SQLTable tab = (SQLTable)tableList.item(idxt);
+                    SQLTable & tab = tableList.item(idxt);
                     normalizedSQL.append(tab.getName());
 
                     if (tab.hasIndexHint())

+ 1 - 1
system/metrics/sinks/file/fileSink.cpp

@@ -58,7 +58,7 @@ void FileMetricSink::collectingHasStopped()
 void FileMetricSink::writeMeasurementToFile(const std::shared_ptr<IMetric> &pMetric) const
 {
     std::string name = pMetric->queryName();
-    auto metaData = pMetric->queryMetaData();
+    const auto & metaData = pMetric->queryMetaData();
     for (auto &metaDataIt: metaData)
     {
         name.append(".").append(metaDataIt.value);

+ 1 - 1
system/metrics/sinks/log/logSink.cpp

@@ -42,7 +42,7 @@ void LogMetricSink::doCollection()
 void LogMetricSink::writeLogEntry(const std::shared_ptr<IMetric> &pMetric)
 {
     std::string name = pMetric->queryName();
-    auto metaData = pMetric->queryMetaData();
+    const auto & metaData = pMetric->queryMetaData();
     for (auto &metaDataIt: metaData)
     {
         name.append(".").append(metaDataIt.value);

+ 1 - 1
system/metrics/sinks/prometheus/prometheusSink.cpp

@@ -125,7 +125,7 @@ void PrometheusMetricSink::toPrometheusMetrics(const std::vector<std::shared_ptr
         }
 
         out.append(name.c_str());
-        auto metaData = pMetric->queryMetaData();
+        const auto & metaData = pMetric->queryMetaData();
         if (metaData.size()>0)
         {
             out.append(" {");