diff --git a/frontend/common/RepackLsResponseStream.cpp b/frontend/common/RepackLsResponseStream.cpp index f961e7901f79dab91793a0db366cf3972c8ec747..eec41272e916767fd8617161926bf1a8cd3c4c6d 100644 --- a/frontend/common/RepackLsResponseStream.cpp +++ b/frontend/common/RepackLsResponseStream.cpp @@ -114,7 +114,7 @@ void RepackLsResponseStream::collectRepacks(const std::optional& vi repackRequestItem->set_last_expanded_fseq(repackRequest.lastExpandedFseq != 0 ? repackRequest.lastExpandedFseq - 1 : 0); repackRequestItem->mutable_destination_infos()->Clear(); - for (auto destinationInfo : repackRequest.destinationInfos) { + for (const auto& destinationInfo : repackRequest.destinationInfos) { auto* destinationInfoToInsert = repackRequestItem->mutable_destination_infos()->Add(); destinationInfoToInsert->set_vid(destinationInfo.vid); destinationInfoToInsert->set_files(destinationInfo.files); diff --git a/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp b/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp index 484e955d8d2c301ed7b7b49aa970c18481252165..42d847529ffe9db031b9dc506ca4e300e9fe66f6 100644 --- a/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp +++ b/frontend/grpc/callback_api/CtaAdminClientReadReactor.hpp @@ -243,7 +243,7 @@ public: } CtaAdminClientReadReactor(cta::xrd::CtaRpcStream::Stub* client_stub, const cta::admin::CtaAdminParsedCmd& parsedCmd) { - const auto request = parsedCmd.getRequest(); + const auto& request = parsedCmd.getRequest(); client_stub->async()->GenericAdminStream(&m_context, &request, this); m_isJson = parsedCmd.isJson(); StartRead(&m_response); // where to store the received response? diff --git a/objectstore/ArchiveFileSerDeser.hpp b/objectstore/ArchiveFileSerDeser.hpp index ca6139665e9ffc19039c808b2280e37b3db06386..9460ba9baad8cfb4991e3f68a90bc08f6f6d1d67 100644 --- a/objectstore/ArchiveFileSerDeser.hpp +++ b/objectstore/ArchiveFileSerDeser.hpp @@ -67,7 +67,7 @@ public: fileSize=osaf.filesize(); reconciliationTime=osaf.reconciliationtime(); storageClass=osaf.storageclass(); - for (auto tf: osaf.tapefiles()) { + for (const auto& tf : osaf.tapefiles()) { TapeFileSerDeser tfsd; tfsd.deserialize(tf); tapeFiles.push_back(tfsd); diff --git a/objectstore/ArchiveQueueShard.cpp b/objectstore/ArchiveQueueShard.cpp index 92db0391e216286259fe20e6eb36bc0667e28d50..cfb7f8e73714b479cfd97039c99fb6cd3de0b3ed 100644 --- a/objectstore/ArchiveQueueShard.cpp +++ b/objectstore/ArchiveQueueShard.cpp @@ -41,7 +41,7 @@ ArchiveQueueShard::ArchiveQueueShard(GenericObject& go): void ArchiveQueueShard::rebuild() { checkPayloadWritable(); uint64_t totalSize=0; - for (auto j: m_payload.archivejobs()) { + for (const auto& j : m_payload.archivejobs()) { totalSize += j.size(); } m_payload.set_archivejobstotalsize(totalSize); diff --git a/scheduler/RetrieveMount.cpp b/scheduler/RetrieveMount.cpp index a4b4d144d592a0c02874a1fe1859d8d8d97bab68..c5bba71889b124387cac017110b3f1edc45afda9 100644 --- a/scheduler/RetrieveMount.cpp +++ b/scheduler/RetrieveMount.cpp @@ -285,7 +285,7 @@ bool cta::RetrieveMount::checkOrReserveFreeDiskSpaceForRequest(const cta::DiskSp uint64_t previousDrivesReservationTotal = 0; auto diskSystem = diskSystemFreeSpace.getDiskSystemList().at(ds); // Compute previous drives reservation for the physical space of the current disk system. - for (auto previousDriveReservation : previousDrivesReservations) { + for (const auto& previousDriveReservation : previousDrivesReservations) { //avoid empty string when no disk space reservation exists for drive if (previousDriveReservation.second != 0) { auto previousDiskSystem = diskSystemFreeSpace.getDiskSystemList().at(previousDriveReservation.first); diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index 888de3a90308164229ac24a1cbdbadb5b25bc963..0c6d4ed34458ef9ac27ecd4827fdf79b6c04eb20 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -2793,7 +2793,7 @@ void Scheduler::triggerTapeStateChange(const common::dataStructures::SecurityIde // Validate tape state change based on previous state auto tape_meta_data = m_catalogue.Tape()->getTapesByVid(vid)[vid]; auto prev_state = tape_meta_data.state; - auto prev_reason = tape_meta_data.stateReason; + const auto& prev_reason = tape_meta_data.stateReason; // User is not allowed to select explicitly a temporary state if (new_state == Tape::BROKEN_PENDING || new_state == Tape::EXPORTED_PENDING || new_state == Tape::REPACKING_PENDING) { diff --git a/statistics/Statistics.cpp b/statistics/Statistics.cpp index b58b56ad40f16327826512fda168f797e3850ec3..da169e841227c93f38b2385c9563546cff42f165 100644 --- a/statistics/Statistics.cpp +++ b/statistics/Statistics.cpp @@ -84,7 +84,7 @@ std::unique_ptr Statistics::Builder::build(cta::rdbms::Rset* rset) { std::ostream & operator <<(std::ostream& stream, const Statistics& stats) { stream << "{" << "\"statisticsPerVo\": ["; - auto allVoStatistics = stats.getAllVOStatistics(); + const auto& allVoStatistics = stats.getAllVOStatistics(); uint64_t nbElementsVoStatistics = allVoStatistics.size(); uint64_t i = 0; for (auto & stat : allVoStatistics) {