Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecoLocalFastTime/FTLRecProducers: fix clang warning: -Wpessimizing-move #22787

Merged
merged 2 commits into from Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -72,7 +72,7 @@ FTLRecHitProducer::produce(edm::Event& evt, const edm::EventSetup& es) {
barrelRechits->reserve(hBarrel->size()/2);
for(const auto& uhit : *hBarrel) {
uint32_t flags = FTLRecHit::kGood;
auto rechit = std::move(barrel_->makeRecHit(uhit, flags));
auto rechit = barrel_->makeRecHit(uhit, flags);
if( flags == FTLRecHit::kGood ) barrelRechits->push_back( std::move(rechit) );
}

Expand All @@ -81,7 +81,7 @@ FTLRecHitProducer::produce(edm::Event& evt, const edm::EventSetup& es) {
endcapRechits->reserve(hEndcap->size()/2);
for(const auto& uhit : *hEndcap) {
uint32_t flags = FTLRecHit::kGood;
auto rechit = std::move(endcap_->makeRecHit(uhit, flags));
auto rechit = endcap_->makeRecHit(uhit, flags);
if( flags == FTLRecHit::kGood ) endcapRechits->push_back( std::move(rechit) );
}

Expand Down
Expand Up @@ -71,14 +71,14 @@ FTLUncalibratedRecHitProducer::produce(edm::Event& evt, const edm::EventSetup& e
evt.getByToken( ftlbDigis_, hBarrel );
barrelRechits->reserve(hBarrel->size()/2);
for(const auto& digi : *hBarrel) {
barrelRechits->push_back( std::move(barrel_->makeRecHit(digi)) );
barrelRechits->push_back( barrel_->makeRecHit(digi) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be changed to emplace_back?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

}

edm::Handle< FTLDigiCollection > hEndcap;
evt.getByToken( ftleDigis_, hEndcap );
endcapRechits->reserve(hEndcap->size()/2);
for(const auto& digi : *hEndcap) {
endcapRechits->push_back( std::move(endcap_->makeRecHit(digi)) );
endcapRechits->push_back( endcap_->makeRecHit(digi) );
}

// put the collection of recunstructed hits in the event
Expand Down