Skip to content

Commit

Permalink
fix llvm10 warning: avoid creating a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Apr 28, 2020
1 parent b9bf1bc commit 2d9f8ab
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ inline edm::DetSet<SiStripRawDigi> SiStripZeroSuppression::formatRawDigis(const
outRawDigis.reserve(rawDigis.size());
const std::vector<bool>& apvf = algorithms->getAPVFlags();
uint32_t strip = 0;
for (const auto rawDigi : rawDigis) {
for (const auto& rawDigi : rawDigis) {
int16_t apvN = strip / 128;
if (apvf[apvN])
outRawDigis.push_back(rawDigi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void SiStripMergeZeroSuppression::produce(edm::Event& event, const edm::EventSet
LogTrace("SiStripMergeZeroSuppression::produce") << "inserting only the digis for not restored APVs"
<< "\n";
LogTrace("SiStripMergeZeroSuppression::produce") << "size : " << zsModule->size() << "\n";
for (const auto itZsMod : *zsModule) {
for (const auto& itZsMod : *zsModule) {
const uint16_t adc = itZsMod.adc();
const uint16_t strip = itZsMod.strip();
if (!restoredAPV[strip / 128]) {
Expand All @@ -115,7 +115,7 @@ void SiStripMergeZeroSuppression::produce(edm::Event& event, const edm::EventSet
LogTrace("SiStripMergeZeroSuppression::produce") << "inserting only the digis for the restored APVs"
<< "\n";
LogTrace("SiStripMergeZeroSuppression::produce") << "size : " << suppressedDigis.size() << "\n";
for (const auto itSuppDigi : suppressedDigis) {
for (const auto& itSuppDigi : suppressedDigis) {
const uint16_t adc = itSuppDigi.adc();
const uint16_t strip = itSuppDigi.strip();
if (restoredAPV[strip / 128]) {
Expand Down
2 changes: 1 addition & 1 deletion RecoMuon/MuonIdentification/plugins/MuonIdProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void MuonIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)

// muons first - no cleaning, take as is.
if (muonCollectionHandle_.isValid()) {
for (const auto muon : *muonCollectionHandle_) {
for (const auto& muon : *muonCollectionHandle_) {
outputMuons->push_back(muon);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace {
Stream ss;
for (auto const& spansLayers : spansLayerSets) {
ss << "Overlapping detGroups:\n";
for (auto const cspan : spansLayers.first) {
for (auto const& cspan : spansLayers.first) {
detGroupSpanInfo(cspan, ss);
ss << std::endl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void TrackProducerAlgorithm<T>::runWithCandidate(const TrackingGeometry* theG,

int cont = 0;
int ntc = 0;
for (auto const theTC : theTCCollection) {
for (auto const& theTC : theTCCollection) {
PTrajectoryStateOnDet const& state = theTC.trajectoryStateOnDet();
const TrackCandidate::range& recHitVec = theTC.recHits();
const TrajectorySeed& seed = theTC.seed();
Expand Down

0 comments on commit 2d9f8ab

Please sign in to comment.