From 122ca71afc364c80a971de9768656b4a50794fac Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Thu, 21 May 2020 10:19:03 +0200 Subject: [PATCH] Test clang-tidy --checks performance-move-const-arg --- .clang-tidy | 1 + .../plugins/MCMisalignmentScaler.cc | 2 +- .../CandUtils/interface/makeCompositeCandidate.h | 2 +- CondFormats/HcalObjects/src/HBHEDarkening.cc | 2 +- .../plugins/SiStripDaqInfo.cc | 2 +- DQMServices/FwkIO/plugins/DQMRootOutputModule.cc | 2 +- DataFormats/Common/interface/DetSetVectorNew.h | 6 +++--- DataFormats/Common/interface/ValidHandle.h | 4 ++-- DataFormats/L1TrackTrigger/src/TTDTC.cc | 2 +- .../PatCandidates/interface/PackedCandidate.h | 2 +- .../PatCandidates/interface/PackedGenParticle.h | 4 ++-- DataFormats/Provenance/src/ProductProvenance.cc | 11 +++++------ .../src/ConditionDumperInEdm.cc | 4 ++-- .../interface/LuminosityBlockPrincipal.h | 2 +- .../Framework/interface/ProductRegistryHelper.h | 2 +- FWCore/Framework/src/Event.cc | 2 +- FWCore/Framework/src/EventProcessor.cc | 6 +++--- .../src/LuminosityBlockProcessingStatus.h | 2 +- FWCore/Framework/src/SubProcess.cc | 2 +- FWCore/Utilities/src/InputTag.cc | 6 +++--- FastSimulation/Tracking/interface/SeedFinder.h | 2 +- Fireworks/Core/src/FWDialogBuilder.cc | 2 +- .../Core/plugins/ExternalGeneratorFilter.cc | 2 +- .../TrackerCommonData/plugins/DDTECModuleAlgo.cc | 2 +- HeterogeneousCore/CUDACore/src/ScopedContext.cc | 2 +- .../L1TMuonEndCap/src/PatternRecognition.cc | 2 +- RecoBTag/CTagging/src/CharmTagger.cc | 2 +- .../Combined/src/CandidateChargeBTagComputer.cc | 2 +- ...didateBoostedDoubleSecondaryVertexComputer.cc | 2 +- RecoBTag/SoftLepton/src/ElectronTagger.cc | 2 +- RecoBTag/SoftLepton/src/MuonTagger.cc | 2 +- .../interface/GenericMVAJetTagComputerWrapper.h | 10 +++++----- .../src/GenericMVAJetTagComputer.cc | 2 +- .../FTLRecProducers/plugins/MTDRecHitProducer.cc | 4 ++-- .../plugins/CTPPSProtonProducer.cc | 2 +- .../interface/HitTripletEDProducerT.h | 2 +- .../plugins/TrajectorySegmentBuilder.cc | 6 +++--- .../CkfPattern/src/CkfTrajectoryBuilder.cc | 4 ++-- .../plugins/TkStripMeasurementDet.cc | 4 ++-- .../src/MeasurementTrackerEvent.cc | 16 ++++++++-------- .../TkDetLayers/src/CompatibleDetToGroupAdder.cc | 2 +- .../TkHitPairs/interface/RecHitsSortedInPhi.h | 2 +- .../TkHitPairs/plugins/HitPairEDProducer.cc | 2 +- .../plugins/PixelInactiveAreaFinder.cc | 2 +- .../src/RectangularEtaPhiTrackingRegion.cc | 4 ++-- SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc | 4 ++-- .../src/MultiTrajectoryStateAssembler.cc | 2 +- .../PatternTools/interface/TrajectorySmoother.h | 2 +- .../TrackFitters/interface/TrajectoryFitter.h | 2 +- Utilities/XrdAdaptor/src/XrdRequestManager.cc | 2 +- 50 files changed, 81 insertions(+), 81 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index b1cc9d2d7a691..a88221b3ca799 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,6 +9,7 @@ Checks: -*, ,modernize-use-equals-delete, ,modernize-use-nullptr, ,modernize-use-override, + ,performance-move-const-arg, ,performance-unnecessary-copy-initialization, ,readability-container-size-empty, ,readability-redundant-string-cstr, diff --git a/Alignment/TrackerAlignment/plugins/MCMisalignmentScaler.cc b/Alignment/TrackerAlignment/plugins/MCMisalignmentScaler.cc index f7d5e06c9d84c..1a6f0da82cf0c 100644 --- a/Alignment/TrackerAlignment/plugins/MCMisalignmentScaler.cc +++ b/Alignment/TrackerAlignment/plugins/MCMisalignmentScaler.cc @@ -205,7 +205,7 @@ void MCMisalignmentScaler::analyze(const edm::Event&, const edm::EventSetup& iSe (*ideal)->rotation().zz() + scaleFactor * zz_diff}}; const AlignTransform rescaledTransform{rescaledTranslation, rescaledRotation, misaligned->rawId()}; - rescaledAlignments.m_align.emplace_back(std::move(rescaledTransform)); + rescaledAlignments.m_align.emplace_back(rescaledTransform); } } diff --git a/CommonTools/CandUtils/interface/makeCompositeCandidate.h b/CommonTools/CandUtils/interface/makeCompositeCandidate.h index 8d86f9a5fb50b..0772d5196911d 100644 --- a/CommonTools/CandUtils/interface/makeCompositeCandidate.h +++ b/CommonTools/CandUtils/interface/makeCompositeCandidate.h @@ -18,7 +18,7 @@ namespace helpers { private: std::unique_ptr cmp_; std::unique_ptr release() { - std::unique_ptr ret(std::move(cmp_.get())); + std::unique_ptr ret(cmp_.get()); cmp_.release(); return ret; } diff --git a/CondFormats/HcalObjects/src/HBHEDarkening.cc b/CondFormats/HcalObjects/src/HBHEDarkening.cc index ccc9a801c71ee..0f2fca22da1f1 100644 --- a/CondFormats/HcalObjects/src/HBHEDarkening.cc +++ b/CondFormats/HcalObjects/src/HBHEDarkening.cc @@ -105,7 +105,7 @@ float HBHEDarkening::degradation(float intlumi, int ieta, int lay) const { //accumulate degradation over years float response = 1.0; std::string yearForLumi = getYearForLumi(intlumi); - assert(yearForLumi.size()); + assert(!yearForLumi.empty()); for (const auto& year : years_) { response *= degradationYear(year, intlumi, ieta, lay); diff --git a/DQM/SiStripMonitorClient/plugins/SiStripDaqInfo.cc b/DQM/SiStripMonitorClient/plugins/SiStripDaqInfo.cc index b321ab039282b..5ac5afcddf6e8 100644 --- a/DQM/SiStripMonitorClient/plugins/SiStripDaqInfo.cc +++ b/DQM/SiStripMonitorClient/plugins/SiStripDaqInfo.cc @@ -68,7 +68,7 @@ void SiStripDaqInfo::bookStatus(DQMStore& dqm_store) { for (auto const& det : det_types) { std::string const me_name{"SiStrip_" + det}; SubDetMEs local_mes{dqm_store.bookFloat(me_name), 0}; - subDetMEsMap_.emplace(det, std::move(local_mes)); + subDetMEsMap_.emplace(det, local_mes); } bookedStatus_ = true; dqm_store.cd(); diff --git a/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc b/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc index 22c7016d856af..6551adde22162 100644 --- a/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc +++ b/DQMServices/FwkIO/plugins/DQMRootOutputModule.cc @@ -338,7 +338,7 @@ void DQMRootOutputModule::openFile(edm::FileBlock const&) { std::string(), "DQMRootOutputModule", description().moduleLabel(), - std::move(guid), + guid, std::string(), branchHash.digest().toString(), std::vector()); diff --git a/DataFormats/Common/interface/DetSetVectorNew.h b/DataFormats/Common/interface/DetSetVectorNew.h index c932aa3df7275..3c6880eee5a50 100644 --- a/DataFormats/Common/interface/DetSetVectorNew.h +++ b/DataFormats/Common/interface/DetSetVectorNew.h @@ -133,11 +133,11 @@ namespace edmNew { size = rh.size; return *this; } - Item(Item&& rh) noexcept : id(std::move(rh.id)), offset(int(rh.offset)), size(std::move(rh.size)) {} + Item(Item&& rh) noexcept : id(rh.id), offset(int(rh.offset)), size(rh.size) {} Item& operator=(Item&& rh) noexcept { - id = std::move(rh.id); + id = rh.id; offset = int(rh.offset); - size = std::move(rh.size); + size = rh.size; return *this; } diff --git a/DataFormats/Common/interface/ValidHandle.h b/DataFormats/Common/interface/ValidHandle.h index cdd373980df2d..5756de8108fda 100644 --- a/DataFormats/Common/interface/ValidHandle.h +++ b/DataFormats/Common/interface/ValidHandle.h @@ -22,12 +22,12 @@ namespace edm { using element_type = T; ValidHandle() = delete; - ValidHandle(T const* prod, ProductID id) noexcept(false) : product_(prod), id_(std::move(id)) { + ValidHandle(T const* prod, ProductID id) noexcept(false) : product_(prod), id_(id) { vhhelper::throwIfNotValid(prod); } //NOTE: C++ disallows references to null - ValidHandle(T const& prod, ProductID id) noexcept(true) : product_(&prod), id_(std::move(id)) {} + ValidHandle(T const& prod, ProductID id) noexcept(true) : product_(&prod), id_(id) {} ValidHandle(const ValidHandle&) = default; ValidHandle& operator=(ValidHandle const& rhs) = default; ~ValidHandle() = default; diff --git a/DataFormats/L1TrackTrigger/src/TTDTC.cc b/DataFormats/L1TrackTrigger/src/TTDTC.cc index 29152e8217a07..0eeb47bd7673a 100644 --- a/DataFormats/L1TrackTrigger/src/TTDTC.cc +++ b/DataFormats/L1TrackTrigger/src/TTDTC.cc @@ -39,7 +39,7 @@ void TTDTC::setStream(int dtcRegion, int dtcBoard, int dtcChannel, const Stream& << "(" << dtcChannel << ") is out of range 0 to " << numOverlappingRegions_ - 1 << "."; throw exception; } - streams_[index(dtcRegion, dtcBoard, dtcChannel)] = move(stream); + streams_[index(dtcRegion, dtcBoard, dtcChannel)] = stream; } // read one specific stream of TTStubRefs using TFP identifier (region[0-8], channel[0-47]) diff --git a/DataFormats/PatCandidates/interface/PackedCandidate.h b/DataFormats/PatCandidates/interface/PackedCandidate.h index fd9a2b4cebfec..8157f32779dc7 100644 --- a/DataFormats/PatCandidates/interface/PackedCandidate.h +++ b/DataFormats/PatCandidates/interface/PackedCandidate.h @@ -254,7 +254,7 @@ namespace pat { track_(iOther.track_.exchange(nullptr)), pdgId_(iOther.pdgId_), qualityFlags_(iOther.qualityFlags_), - pvRefProd_(std::move(iOther.pvRefProd_)), + pvRefProd_(iOther.pvRefProd_), pvRefKey_(iOther.pvRefKey_), m_(iOther.m_.exchange(nullptr)), packedHits_(iOther.packedHits_), diff --git a/DataFormats/PatCandidates/interface/PackedGenParticle.h b/DataFormats/PatCandidates/interface/PackedGenParticle.h index 207aa58657ca0..897ecf2135cf0 100644 --- a/DataFormats/PatCandidates/interface/PackedGenParticle.h +++ b/DataFormats/PatCandidates/interface/PackedGenParticle.h @@ -99,7 +99,7 @@ namespace pat { dphi_(iOther.dphi_), pdgId_(iOther.pdgId_), charge_(iOther.charge_), - mother_(std::move(iOther.mother_)), + mother_(iOther.mother_), statusFlags_(iOther.statusFlags_) { if (iOther.p4c_) { p4_.store(p4_.exchange(nullptr)); @@ -126,7 +126,7 @@ namespace pat { dphi_ = iOther.dphi_; pdgId_ = iOther.pdgId_; charge_ = iOther.charge_; - mother_ = std::move(iOther.mother_); + mother_ = iOther.mother_; statusFlags_ = iOther.statusFlags_; } return *this; diff --git a/DataFormats/Provenance/src/ProductProvenance.cc b/DataFormats/Provenance/src/ProductProvenance.cc index bb67586499474..0263f29547665 100644 --- a/DataFormats/Provenance/src/ProductProvenance.cc +++ b/DataFormats/Provenance/src/ProductProvenance.cc @@ -14,23 +14,22 @@ namespace { namespace edm { ProductProvenance::ProductProvenance() : branchID_(), parentageID_() {} - ProductProvenance::ProductProvenance(BranchID bid) : branchID_(std::move(bid)), parentageID_() {} + ProductProvenance::ProductProvenance(BranchID bid) : branchID_(bid), parentageID_() {} ProductProvenance::ProductProvenance(BranchID bid, ParentageID edid) - : branchID_(std::move(bid)), parentageID_(std::move(edid)) {} + : branchID_(bid), parentageID_(std::move(edid)) {} ProductProvenance::ProductProvenance(BranchID bid, std::vector const& parents) - : branchID_(std::move(bid)), parentageID_() { + : branchID_(bid), parentageID_() { Parentage p; p.setParents(parents); parentageID_ = p.id(); ParentageRegistry::instance()->insertMapped(p); } - ProductProvenance::ProductProvenance(BranchID bid, std::vector&& parents) - : branchID_(std::move(bid)), parentageID_() { + ProductProvenance::ProductProvenance(BranchID bid, std::vector&& parents) : branchID_(bid), parentageID_() { Parentage p; - p.setParents(std::move(parents)); + p.setParents(parents); parentageID_ = p.id(); ParentageRegistry::instance()->insertMapped(std::move(p)); } diff --git a/EventFilter/L1GlobalTriggerRawToDigi/src/ConditionDumperInEdm.cc b/EventFilter/L1GlobalTriggerRawToDigi/src/ConditionDumperInEdm.cc index e91607f1478d2..b9655079d98af 100644 --- a/EventFilter/L1GlobalTriggerRawToDigi/src/ConditionDumperInEdm.cc +++ b/EventFilter/L1GlobalTriggerRawToDigi/src/ConditionDumperInEdm.cc @@ -33,7 +33,7 @@ std::shared_ptr ConditionDumperInEdm::globalBeginLum } void ConditionDumperInEdm::endLuminosityBlockProduce(edm::LuminosityBlock& lumi, edm::EventSetup const& setup) { - lumi.emplace(lumiToken_, std::move(*luminosityBlockCache(lumi.index()))); + lumi.emplace(lumiToken_, *luminosityBlockCache(lumi.index())); } std::shared_ptr ConditionDumperInEdm::globalBeginRun(edm::Run const&, @@ -52,7 +52,7 @@ void ConditionDumperInEdm::endRunProduce(edm::Run& run, const edm::EventSetup& s runBlock.BAvgCurrent = sum->m_avg_current; } - run.emplace(runToken_, std::move(runBlock)); + run.emplace(runToken_, runBlock); } // ------------ method called to produce the data ------------ diff --git a/FWCore/Framework/interface/LuminosityBlockPrincipal.h b/FWCore/Framework/interface/LuminosityBlockPrincipal.h index 4f71d35bb61b3..c4e8126f09f1b 100644 --- a/FWCore/Framework/interface/LuminosityBlockPrincipal.h +++ b/FWCore/Framework/interface/LuminosityBlockPrincipal.h @@ -60,7 +60,7 @@ namespace edm { LuminosityBlockNumber_t luminosityBlock() const { return aux().luminosityBlock(); } - void setAux(LuminosityBlockAuxiliary iAux) { aux_ = std::move(iAux); } + void setAux(LuminosityBlockAuxiliary iAux) { aux_ = iAux; } LuminosityBlockAuxiliary const& aux() const { return aux_; } RunNumber_t run() const { return aux().run(); } diff --git a/FWCore/Framework/interface/ProductRegistryHelper.h b/FWCore/Framework/interface/ProductRegistryHelper.h index 0d642d94e1028..a4a5793021d7b 100644 --- a/FWCore/Framework/interface/ProductRegistryHelper.h +++ b/FWCore/Framework/interface/ProductRegistryHelper.h @@ -49,7 +49,7 @@ namespace edm { }; struct BranchAliasSetter { - BranchAliasSetter(TypeLabelItem& iItem, EDPutToken iToken) : value_(iItem), token_(std::move(iToken)) {} + BranchAliasSetter(TypeLabelItem& iItem, EDPutToken iToken) : value_(iItem), token_(iToken) {} BranchAliasSetter& setBranchAlias(std::string alias) { value_.branchAlias_ = std::move(alias); diff --git a/FWCore/Framework/src/Event.cc b/FWCore/Framework/src/Event.cc index 978fd3b955e87..2f28459389c0a 100644 --- a/FWCore/Framework/src/Event.cc +++ b/FWCore/Framework/src/Event.cc @@ -196,7 +196,7 @@ namespace edm { previousBranchIDs_->assign(gotBranchIDVector.begin(), gotBranchIDVector.end()); Parentage p; - p.setParents(std::move(gotBranchIDVector)); + p.setParents(gotBranchIDVector); *previousParentageId = p.id(); ParentageRegistry::instance()->insertMapped(p); } diff --git a/FWCore/Framework/src/EventProcessor.cc b/FWCore/Framework/src/EventProcessor.cc index 6749eb18b3fa2..9d877ef369f01 100644 --- a/FWCore/Framework/src/EventProcessor.cc +++ b/FWCore/Framework/src/EventProcessor.cc @@ -1259,11 +1259,11 @@ namespace edm { unsigned int streamIndex = 0; for (; streamIndex < preallocations_.numberOfStreams() - 1; ++streamIndex) { tbb::task::enqueue(*edm::make_functor_task(tbb::task::allocate_root(), [this, streamIndex, h = iHolder]() { - handleNextEventForStreamAsync(std::move(h), streamIndex); + handleNextEventForStreamAsync(h, streamIndex); })); } tbb::task::spawn(*edm::make_functor_task(tbb::task::allocate_root(), [this, streamIndex, h = std::move(iHolder)]() { - handleNextEventForStreamAsync(std::move(h), streamIndex); + handleNextEventForStreamAsync(h, streamIndex); })); } @@ -1734,7 +1734,7 @@ namespace edm { })); WaitingTaskHolder afterProcessTask; if (subProcesses_.empty()) { - afterProcessTask = std::move(finalizeEventTask); + afterProcessTask = finalizeEventTask; } else { //Need to run SubProcesses after schedule has finished // with the event diff --git a/FWCore/Framework/src/LuminosityBlockProcessingStatus.h b/FWCore/Framework/src/LuminosityBlockProcessingStatus.h index 456e4a9c06d29..415dc050466f7 100644 --- a/FWCore/Framework/src/LuminosityBlockProcessingStatus.h +++ b/FWCore/Framework/src/LuminosityBlockProcessingStatus.h @@ -98,7 +98,7 @@ namespace edm { } edm::Timestamp const& lastTimestamp() const { return endTime_; } - void setNextSyncValue(IOVSyncValue iValue) { nextSyncValue_ = std::move(iValue); } + void setNextSyncValue(IOVSyncValue iValue) { nextSyncValue_ = iValue; } const IOVSyncValue nextSyncValue() const { return nextSyncValue_; } diff --git a/FWCore/Framework/src/SubProcess.cc b/FWCore/Framework/src/SubProcess.cc index bf16df9024a58..5761dec52fb83 100644 --- a/FWCore/Framework/src/SubProcess.cc +++ b/FWCore/Framework/src/SubProcess.cc @@ -381,7 +381,7 @@ namespace edm { })); WaitingTaskHolder afterProcessTask; if (subProcesses_.empty()) { - afterProcessTask = std::move(finalizeEventTask); + afterProcessTask = finalizeEventTask; } else { afterProcessTask = WaitingTaskHolder( make_waiting_task(tbb::task::allocate_root(), diff --git a/FWCore/Utilities/src/InputTag.cc b/FWCore/Utilities/src/InputTag.cc index 9ced17a6c5525..663e5be96696d 100644 --- a/FWCore/Utilities/src/InputTag.cc +++ b/FWCore/Utilities/src/InputTag.cc @@ -83,9 +83,9 @@ namespace edm { } InputTag::InputTag(InputTag&& other) - : label_(std::move(other.label())), - instance_(std::move(other.instance())), - process_(std::move(other.process())), + : label_(other.label()), + instance_(other.instance()), + process_(other.process()), typeID_(), productRegistry_(nullptr), index_(ProductResolverIndexInvalid), diff --git a/FastSimulation/Tracking/interface/SeedFinder.h b/FastSimulation/Tracking/interface/SeedFinder.h index 0e76c0606704b..b6e1df324574d 100644 --- a/FastSimulation/Tracking/interface/SeedFinder.h +++ b/FastSimulation/Tracking/interface/SeedFinder.h @@ -51,7 +51,7 @@ class SeedFinder { std::vector seedHitCandidates; for (const FastTrackerRecHit* trackerRecHit : trackerRecHits) { TrajectorySeedHitCandidate seedHitCandidate(trackerRecHit, _trackerTopology); - seedHitCandidates.push_back(std::move(seedHitCandidate)); + seedHitCandidates.push_back(seedHitCandidate); } return iterateHits(0, seedHitCandidates, hitIndicesInTree, true); diff --git a/Fireworks/Core/src/FWDialogBuilder.cc b/Fireworks/Core/src/FWDialogBuilder.cc index d835b3030303d..95bb9157e3b7e 100644 --- a/Fireworks/Core/src/FWDialogBuilder.cc +++ b/Fireworks/Core/src/FWDialogBuilder.cc @@ -51,7 +51,7 @@ FWLayoutBuilder &FWLayoutBuilder::indent(int left /*= 2*/, int right /* = -1*/) /** Return the last vertical frame, for more control on the layout. */ TGVerticalFrame *FWLayoutBuilder::verticalFrame(void) { - assert(m_framesStack.size()); + assert(!m_framesStack.empty()); return m_framesStack.back(); } diff --git a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc index 91eb2c1dac81c..be4ab0cc9f429 100644 --- a/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc +++ b/GeneratorInterface/Core/plugins/ExternalGeneratorFilter.cc @@ -342,7 +342,7 @@ void ExternalGeneratorFilter::streamEndLuminosityBlockSummary(edm::StreamID iID, void ExternalGeneratorFilter::globalEndLuminosityBlockProduce(edm::LuminosityBlock& iLuminosityBlock, edm::EventSetup const&, GenLumiInfoProduct const* iProduct) const { - iLuminosityBlock.emplace(lumiInfoToken_, std::move(*iProduct)); + iLuminosityBlock.emplace(lumiInfoToken_, *iProduct); } DEFINE_FWK_MODULE(ExternalGeneratorFilter); diff --git a/Geometry/TrackerCommonData/plugins/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/DDTECModuleAlgo.cc index bb5eab60299d1..1dfb38b3204bd 100644 --- a/Geometry/TrackerCommonData/plugins/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/DDTECModuleAlgo.cc @@ -343,7 +343,7 @@ void DDTECModuleAlgo::doPos(DDLogicalPart toPos, double x, double y, double z, s if (rotName == "NULL") rotName = standardRot; - doPos(move(toPos), parent(), copyNr, x, y, z, rotName, cpv); + doPos(toPos, parent(), copyNr, x, y, z, rotName, cpv); } void DDTECModuleAlgo::execute(DDCompactView& cpv) { diff --git a/HeterogeneousCore/CUDACore/src/ScopedContext.cc b/HeterogeneousCore/CUDACore/src/ScopedContext.cc index 7461ebbee9f0d..ccf7995a20061 100644 --- a/HeterogeneousCore/CUDACore/src/ScopedContext.cc +++ b/HeterogeneousCore/CUDACore/src/ScopedContext.cc @@ -93,7 +93,7 @@ namespace cms::cuda { ScopedContextAcquire::~ScopedContextAcquire() { holderHelper_.enqueueCallback(device(), stream()); if (contextState_) { - contextState_->set(device(), std::move(streamPtr())); + contextState_->set(device(), streamPtr()); } } diff --git a/L1Trigger/L1TMuonEndCap/src/PatternRecognition.cc b/L1Trigger/L1TMuonEndCap/src/PatternRecognition.cc index f0195a950d42f..78b92317240fb 100644 --- a/L1Trigger/L1TMuonEndCap/src/PatternRecognition.cc +++ b/L1Trigger/L1TMuonEndCap/src/PatternRecognition.cc @@ -443,7 +443,7 @@ void PatternRecognition::process_single_zone(int zone, // Find max quality code in a given key_zhit if (max_quality_code < quality_code) { max_quality_code = quality_code; - tmp_road = std::move(road); + tmp_road = road; } } // end if is_lifetime_up diff --git a/RecoBTag/CTagging/src/CharmTagger.cc b/RecoBTag/CTagging/src/CharmTagger.cc index 65e565d4a9485..b7384677eca67 100644 --- a/RecoBTag/CTagging/src/CharmTagger.cc +++ b/RecoBTag/CTagging/src/CharmTagger.cc @@ -29,7 +29,7 @@ CharmTagger::CharmTagger(const edm::ParameterSet &configuration, Tokens tokens) use_GBRForest_(configuration.getParameter("useGBRForest")), use_adaBoost_(configuration.getParameter("useAdaBoost")), defaultValueNoTracks_(configuration.getParameter("defaultValueNoTracks")), - tokens_{std::move(tokens)} { + tokens_{tokens} { vpset vars_definition = configuration.getParameter("variables"); for (auto &var : vars_definition) { MVAVar mva_var; diff --git a/RecoBTag/Combined/src/CandidateChargeBTagComputer.cc b/RecoBTag/Combined/src/CandidateChargeBTagComputer.cc index 5cdd051aa29d2..fb00816c1f7d7 100644 --- a/RecoBTag/Combined/src/CandidateChargeBTagComputer.cc +++ b/RecoBTag/Combined/src/CandidateChargeBTagComputer.cc @@ -11,7 +11,7 @@ CandidateChargeBTagComputer::CandidateChargeBTagComputer(const edm::ParameterSet useAdaBoost_(parameters.getParameter("useAdaBoost")), jetChargeExp_(parameters.getParameter("jetChargeExp")), svChargeExp_(parameters.getParameter("svChargeExp")), - tokens_{std::move(tokens)} { + tokens_{tokens} { uses(0, "pfImpactParameterTagInfos"); uses(1, "pfInclusiveSecondaryVertexFinderCvsLTagInfos"); uses(2, "softPFMuonsTagInfos"); diff --git a/RecoBTag/SecondaryVertex/src/CandidateBoostedDoubleSecondaryVertexComputer.cc b/RecoBTag/SecondaryVertex/src/CandidateBoostedDoubleSecondaryVertexComputer.cc index e8fbe2ba8b9a4..9662726ebc87f 100644 --- a/RecoBTag/SecondaryVertex/src/CandidateBoostedDoubleSecondaryVertexComputer.cc +++ b/RecoBTag/SecondaryVertex/src/CandidateBoostedDoubleSecondaryVertexComputer.cc @@ -24,7 +24,7 @@ CandidateBoostedDoubleSecondaryVertexComputer::CandidateBoostedDoubleSecondaryVe : edm::FileInPath()), useGBRForest_(parameters.existsAs("useGBRForest") ? parameters.getParameter("useGBRForest") : false), useAdaBoost_(parameters.existsAs("useAdaBoost") ? parameters.getParameter("useAdaBoost") : false), - tokens_{std::move(tokens)} { + tokens_{tokens} { uses(0, "svTagInfos"); mvaID.reset(new TMVAEvaluator()); diff --git a/RecoBTag/SoftLepton/src/ElectronTagger.cc b/RecoBTag/SoftLepton/src/ElectronTagger.cc index ea09b45816666..ac89e93c4f8d2 100644 --- a/RecoBTag/SoftLepton/src/ElectronTagger.cc +++ b/RecoBTag/SoftLepton/src/ElectronTagger.cc @@ -25,7 +25,7 @@ ElectronTagger::ElectronTagger(const edm::ParameterSet& cfg, Tokens tokens) : edm::FileInPath()), m_useGBRForest(cfg.existsAs("useGBRForest") ? cfg.getParameter("useGBRForest") : false), m_useAdaBoost(cfg.existsAs("useAdaBoost") ? cfg.getParameter("useAdaBoost") : false), - m_tokens{std::move(tokens)} { + m_tokens{tokens} { uses("seTagInfos"); mvaID.reset(new TMVAEvaluator()); } diff --git a/RecoBTag/SoftLepton/src/MuonTagger.cc b/RecoBTag/SoftLepton/src/MuonTagger.cc index 27e850058ca85..99aa1a29c265f 100644 --- a/RecoBTag/SoftLepton/src/MuonTagger.cc +++ b/RecoBTag/SoftLepton/src/MuonTagger.cc @@ -26,7 +26,7 @@ MuonTagger::MuonTagger(const edm::ParameterSet& cfg, Tokens tokens) : edm::FileInPath()), m_useGBRForest(cfg.existsAs("useGBRForest") ? cfg.getParameter("useGBRForest") : false), m_useAdaBoost(cfg.existsAs("useAdaBoost") ? cfg.getParameter("useAdaBoost") : false), - m_tokens{std::move(tokens)} { + m_tokens{tokens} { uses("smTagInfos"); mvaID.reset(new TMVAEvaluator()); } diff --git a/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputerWrapper.h b/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputerWrapper.h index 47bc968fed976..7a29fae57443f 100644 --- a/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputerWrapper.h +++ b/RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputerWrapper.h @@ -49,7 +49,7 @@ template makeRecHit(uhit, flags); if (flags == FTLRecHit::kGood) - barrelRechits->push_back(std::move(rechit)); + barrelRechits->push_back(rechit); } edm::Handle hEndcap; @@ -93,7 +93,7 @@ void MTDRecHitProducer::produce(edm::Event& evt, const edm::EventSetup& es) { uint32_t flags = FTLRecHit::kGood; auto rechit = endcap_->makeRecHit(uhit, flags); if (flags == FTLRecHit::kGood) - endcapRechits->push_back(std::move(rechit)); + endcapRechits->push_back(rechit); } // put the collection of recunstructed hits in the event diff --git a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc index 7f4f178bccd39..632eda85a8593 100644 --- a/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc +++ b/RecoPPS/ProtonReconstruction/plugins/CTPPSProtonProducer.cc @@ -491,7 +491,7 @@ void CTPPSProtonProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSe // save single-RP results (un-indexed) for (const auto &p : singleRPResultsIndexed) - pOutSingleRP->emplace_back(std::move(p.second)); + pOutSingleRP->emplace_back(p.second); } // dump log diff --git a/RecoPixelVertexing/PixelTriplets/interface/HitTripletEDProducerT.h b/RecoPixelVertexing/PixelTriplets/interface/HitTripletEDProducerT.h index 7ef4dd44bc39d..db514f7380585 100644 --- a/RecoPixelVertexing/PixelTriplets/interface/HitTripletEDProducerT.h +++ b/RecoPixelVertexing/PixelTriplets/interface/HitTripletEDProducerT.h @@ -251,7 +251,7 @@ namespace hitTripletEDProducerT { auto beginRegion(const TrackingRegion* region, LayerHitMapCache*) { auto filler = intermediateHitTriplets_->beginRegion(region); - return std::make_tuple(&(filler.layerHitMapCache()), std::move(filler)); + return std::make_tuple(&(filler.layerHitMapCache()), filler); } std::vector* tripletLastLayerIndexVector() { return &tripletLastLayerIndex_; } diff --git a/RecoTracker/CkfPattern/plugins/TrajectorySegmentBuilder.cc b/RecoTracker/CkfPattern/plugins/TrajectorySegmentBuilder.cc index 113f89517ddd5..7204e311b5d55 100644 --- a/RecoTracker/CkfPattern/plugins/TrajectorySegmentBuilder.cc +++ b/RecoTracker/CkfPattern/plugins/TrajectorySegmentBuilder.cc @@ -194,7 +194,7 @@ void TrajectorySegmentBuilder::updateTrajectory(TempTrajectory& traj, TM tm) con if (hit->isValid()) { auto&& upState = theUpdator.update(predictedState, *hit); - traj.emplace(std::move(predictedState), std::move(upState), std::move(hit), tm.estimate(), tm.layer()); + traj.emplace(predictedState, std::move(upState), hit, tm.estimate(), tm.layer()); // TrajectoryMeasurement tm(traj.lastMeasurement()); // if ( tm.updatedState().isValid() ) { @@ -209,7 +209,7 @@ void TrajectorySegmentBuilder::updateTrajectory(TempTrajectory& traj, TM tm) con // } // } } else { - traj.emplace(std::move(predictedState), std::move(hit), 0, tm.layer()); + traj.emplace(predictedState, hit, 0, tm.layer()); } } @@ -252,7 +252,7 @@ TrajectorySegmentBuilder::TempTrajectoryContainer TrajectorySegmentBuilder::addG if (theBestHitOnly) { updateCandidatesWithBestHit(traj, std::move(meas.front()), updatedTrajectories); } else { - updateCandidates(traj, std::move(meas), updatedTrajectories); + updateCandidates(traj, meas, updatedTrajectories); } if UNLIKELY(theDbgFlg) diff --git a/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc b/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc index 8120b6b657487..f2712492a150e 100644 --- a/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc +++ b/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc @@ -303,9 +303,9 @@ void CkfTrajectoryBuilder::updateTrajectory(TempTrajectory& traj, TM&& tm) const auto&& hit = tm.recHit(); if (hit->isValid()) { auto&& upState = theUpdator->update(predictedState, *hit); - traj.emplace(std::move(predictedState), std::move(upState), std::move(hit), tm.estimate(), tm.layer()); + traj.emplace(predictedState, std::move(upState), hit, tm.estimate(), tm.layer()); } else { - traj.emplace(std::move(predictedState), std::move(hit), 0, tm.layer()); + traj.emplace(predictedState, hit, 0, tm.layer()); } } diff --git a/RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc b/RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc index d0b6585efbd2b..6d655fb7d712f 100644 --- a/RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc +++ b/RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc @@ -83,7 +83,7 @@ bool TkStripMeasurementDet::recHits(SimpleHitContainer& result, if (!isCompatible) break; // exit loop on first incompatible hit for (auto&& h : tmp) - result.push_back(new SiStripRecHit2D(std::move(h))); + result.push_back(new SiStripRecHit2D(h)); tmp.clear(); } } @@ -93,7 +93,7 @@ bool TkStripMeasurementDet::recHits(SimpleHitContainer& result, if (!isCompatible) break; // exit loop on first incompatible hit for (auto&& h : tmp) - result.push_back(new SiStripRecHit2D(std::move(h))); + result.push_back(new SiStripRecHit2D(h)); tmp.clear(); } diff --git a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc index 32f51529beaff..274a2f62cfbde 100644 --- a/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc +++ b/RecoTracker/MeasurementDet/src/MeasurementTrackerEvent.cc @@ -14,20 +14,20 @@ MeasurementTrackerEvent::~MeasurementTrackerEvent() { } MeasurementTrackerEvent::MeasurementTrackerEvent(MeasurementTrackerEvent &&other) { - theTracker = std::move(other.theTracker); - theStripData = std::move(other.theStripData); - thePixelData = std::move(other.thePixelData); - thePhase2OTData = std::move(other.thePhase2OTData); + theTracker = other.theTracker; + theStripData = other.theStripData; + thePixelData = other.thePixelData; + thePhase2OTData = other.thePhase2OTData; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); thePixelClustersToSkip = std::move(other.thePixelClustersToSkip); } MeasurementTrackerEvent &MeasurementTrackerEvent::operator=(MeasurementTrackerEvent &&other) { - theTracker = std::move(other.theTracker); - theStripData = std::move(other.theStripData); - thePixelData = std::move(other.thePixelData); - thePhase2OTData = std::move(other.thePhase2OTData); + theTracker = other.theTracker; + theStripData = other.theStripData; + thePixelData = other.thePixelData; + thePhase2OTData = other.thePhase2OTData; theOwner = other.theOwner; other.theOwner = false; // make sure to fully transfer the ownership theStripClustersToSkip = std::move(other.theStripClustersToSkip); diff --git a/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc b/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc index 4759bc2f3a010..c34e498709450 100644 --- a/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc +++ b/RecoTracker/TkDetLayers/src/CompatibleDetToGroupAdder.cc @@ -33,7 +33,7 @@ bool CompatibleDetToGroupAdder::add(const GeometricSearchDet& det, << "CompatibleDetToGroupAdder: det is not grouped but result has more than one group!"; result.front().reserve(result.front().size() + compatDets.size()); for (vector::const_iterator i = compatDets.begin(); i != compatDets.end(); i++) - result.front().push_back(std::move(*i)); + result.front().push_back(*i); } return true; } diff --git a/RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h b/RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h index d0270653c25b7..cadec4e0d1d8e 100644 --- a/RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h +++ b/RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h @@ -131,7 +131,7 @@ class HitDoublets { HitDoublets(RecHitsSortedInPhi const& in, RecHitsSortedInPhi const& out) : layers{{&in, &out}} {} - HitDoublets(HitDoublets&& rh) : layers(std::move(rh.layers)), indeces(std::move(rh.indeces)) {} + HitDoublets(HitDoublets&& rh) : layers(rh.layers), indeces(std::move(rh.indeces)) {} void reserve(std::size_t s) { indeces.reserve(s); } std::size_t size() const { return indeces.size(); } diff --git a/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc b/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc index 917a07a3fafbc..11f4d513afbba 100644 --- a/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc +++ b/RecoTracker/TkHitPairs/plugins/HitPairEDProducer.cc @@ -202,7 +202,7 @@ namespace { auto beginRegion(const TrackingRegion* region, LayerHitMapCache*) { auto filler = intermediateHitDoublets_->beginRegion(region); - return std::make_tuple(&(filler.layerHitMapCache()), std::move(filler)); + return std::make_tuple(&(filler.layerHitMapCache()), filler); } void fill(IntermediateHitDoublets::RegionFiller& filler, diff --git a/RecoTracker/TkTrackingRegions/plugins/PixelInactiveAreaFinder.cc b/RecoTracker/TkTrackingRegions/plugins/PixelInactiveAreaFinder.cc index 2ecbfdd9b7b45..dd17b7e61c0a8 100644 --- a/RecoTracker/TkTrackingRegions/plugins/PixelInactiveAreaFinder.cc +++ b/RecoTracker/TkTrackingRegions/plugins/PixelInactiveAreaFinder.cc @@ -391,7 +391,7 @@ PixelInactiveAreaFinder::InactiveAreas::areasAndLayerSets(const GlobalPoint& poi outerSpan.phiSpan.second, outerSpan.zSpan.first, outerSpan.zSpan.second); - ret.emplace_back(std::move(areas), std::move(item.second)); + ret.emplace_back(areas, std::move(item.second)); } return ret; diff --git a/RecoTracker/TkTrackingRegions/src/RectangularEtaPhiTrackingRegion.cc b/RecoTracker/TkTrackingRegions/src/RectangularEtaPhiTrackingRegion.cc index 1f773abc7b04d..71c3c06d272b2 100644 --- a/RecoTracker/TkTrackingRegions/src/RectangularEtaPhiTrackingRegion.cc +++ b/RecoTracker/TkTrackingRegions/src/RectangularEtaPhiTrackingRegion.cc @@ -369,7 +369,7 @@ TrackingRegion::Hits RectangularEtaPhiTrackingRegion::hits(const edm::EventSetup result.reserve(layerHits.size()); for (auto&& ih : layerHits) { if (hitComp(*ih)) - result.emplace_back(std::move(ih)); + result.emplace_back(ih); } } else { @@ -383,7 +383,7 @@ TrackingRegion::Hits RectangularEtaPhiTrackingRegion::hits(const edm::EventSetup result.reserve(layerHits.size()); for (auto&& ih : layerHits) { if (hitComp(*ih)) - result.emplace_back(std::move(ih)); + result.emplace_back(ih); } } } diff --git a/SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc b/SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc index e3e3856504812..03fb8ad0f6e11 100644 --- a/SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc +++ b/SimCalorimetry/EcalSimAlgos/src/ESDigitizer.cc @@ -155,7 +155,7 @@ void ESDigitizer::run(ESDigiCollection& output, CLHEP::HepRandomEngine* engine) analogSignal[2] = m_histoInf + m_histoWid * trip.third; ESDataFrame digi(*idItr); const_cast(elecSim())->analogToDigital(engine, analogSignal, digi, true); - output.push_back(std::move(digi)); + output.push_back(digi); } } } @@ -179,6 +179,6 @@ void ESDigitizer::createNoisyList(std::vector& abThreshCh, CLHEP::HepRand idItr = find(abThreshCh.begin(), abThreshCh.end(), id); } while (idItr != abThreshCh.end()); - abThreshCh.push_back(std::move(id)); + abThreshCh.push_back(id); } } diff --git a/TrackingTools/GsfTools/src/MultiTrajectoryStateAssembler.cc b/TrackingTools/GsfTools/src/MultiTrajectoryStateAssembler.cc index 707124210cc47..8cf4033039870 100644 --- a/TrackingTools/GsfTools/src/MultiTrajectoryStateAssembler.cc +++ b/TrackingTools/GsfTools/src/MultiTrajectoryStateAssembler.cc @@ -199,7 +199,7 @@ void MultiTrajectoryStateAssembler::removeWrongPz() { for (auto const &is : oldStates) { if (meanPz * is.localParameters().pzSign() >= 0.) { theValidWeightSum += is.weight(); - theStates.push_back(std::move(is)); + theStates.push_back(is); } else { theInvalidWeightSum += is.weight(); LogDebug("GsfTrackFitters") << "removing weight / pz / global position = " << is.weight() << " " diff --git a/TrackingTools/PatternTools/interface/TrajectorySmoother.h b/TrackingTools/PatternTools/interface/TrajectorySmoother.h index c30133896c7fa..e46dbef681f7f 100644 --- a/TrackingTools/PatternTools/interface/TrajectorySmoother.h +++ b/TrackingTools/PatternTools/interface/TrajectorySmoother.h @@ -18,7 +18,7 @@ class TrajectorySmoother { virtual TrajectoryContainer trajectories(const Trajectory& traj) const { Trajectory&& nt = trajectory(traj); if (nt.isValid()) - return TrajectoryContainer(1, std::move(nt)); + return TrajectoryContainer(1, nt); return TrajectoryContainer(); } virtual Trajectory trajectory(const Trajectory&) const = 0; diff --git a/TrackingTools/TrackFitters/interface/TrajectoryFitter.h b/TrackingTools/TrackFitters/interface/TrajectoryFitter.h index ec2a99365d4af..6990671211eb3 100644 --- a/TrackingTools/TrackFitters/interface/TrajectoryFitter.h +++ b/TrackingTools/TrackFitters/interface/TrajectoryFitter.h @@ -57,7 +57,7 @@ class TrajectoryFitter { private: static std::vector makeVect(Trajectory&& outTraj) { if (outTraj.isValid()) - return std::vector(1, std::move(outTraj)); + return std::vector(1, outTraj); return std::vector(); } }; diff --git a/Utilities/XrdAdaptor/src/XrdRequestManager.cc b/Utilities/XrdAdaptor/src/XrdRequestManager.cc index 52ede2ee6bf73..21cf843a73350 100644 --- a/Utilities/XrdAdaptor/src/XrdRequestManager.cc +++ b/Utilities/XrdAdaptor/src/XrdRequestManager.cc @@ -401,7 +401,7 @@ void RequestManager::checkSourcesImpl(timespec &now, inactiveSources.erase(it); break; } - inactiveSources.emplace_back(std::move(*worstActiveSource)); + inactiveSources.emplace_back(*worstActiveSource); auto oldSources = activeSources; activeSources.erase(worstActiveSource); activeSources.emplace_back(std::move(*bestInactiveSource));