From 4972edd1195ca420aba95be7638a5e859a27154e Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Fri, 11 Dec 2020 15:06:11 +0000 Subject: [PATCH] TileConditions: Fix gcc11 warnings. Spurious copies in for loops. --- .../TileConditions/test/TileDCSComponents_test.cxx | 4 ++-- .../TrigConfData/TrigConfData/DataStructure.h | 1 + Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx b/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx index c70774b4a3b..aec6ba7b680 100644 --- a/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx +++ b/TileCalorimeter/TileConditions/test/TileDCSComponents_test.cxx @@ -209,14 +209,14 @@ void prepareDCSFolder(const std::string& key, const FolderData<T>& folderData) { std::unique_ptr<CondAttrListCollection> data = std::make_unique<CondAttrListCollection>(true); - for (const auto coolChannelData : folderData) { + for (const auto& coolChannelData : folderData) { unsigned int coolChannel = coolChannelData.first; const auto nameValuePairs = coolChannelData.second; coral::AttributeList attributeList; - for (const std::pair<std::string, T> nameValuePair : nameValuePairs) { + for (const std::pair<std::string, T>& nameValuePair : nameValuePairs) { std::string name = nameValuePair.first; T value = nameValuePair.second; attributeList.extend<T>(name); diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h index da6a9fe0fb6..856e64e1033 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/DataStructure.h @@ -13,6 +13,7 @@ #include <vector> #include <memory> #include <type_traits> +#include <optional> #include "boost/property_tree/ptree.hpp" namespace TrigConf { diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx index 3becff35226..282094b0073 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1Menu.cxx @@ -28,7 +28,7 @@ TrigConf::L1Menu::update() try { m_name = getAttribute("name"); // thresholds - for( const std::string & path : {"thresholds", "thresholds.legacyCalo" } ) { + for( const std::string path : {"thresholds", "thresholds.legacyCalo" } ) { for( auto & thrByType : data().get_child( path ) ) { const std::string & thrType = thrByType.first; if (thrType == "legacyCalo") @@ -93,7 +93,7 @@ TrigConf::L1Menu::update() try { // algorithms - for( const std::string & algoCategory : { "TOPO", "MULTTOPO", "MUTOPO", "R2TOPO" } ) { + for( const std::string algoCategory : { "TOPO", "MULTTOPO", "MUTOPO", "R2TOPO" } ) { auto & v = m_algorithmsByCategory[algoCategory] = std::vector<TrigConf::L1TopoAlgorithm>(); if(algoCategory == "MULTTOPO") { for( auto & alg : data().get_child( "topoAlgorithms." + algoCategory + ".multiplicityAlgorithms" ) ) { -- GitLab