Skip to content

Commit cb79358

Browse files
Compiler says to loop over reference and not copy - makes sense
1 parent df06e6d commit cb79358

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

rooutil/examples/PrintEvents.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void PrintEvents(std::string filename) {
258258
}
259259

260260
// trigger branches
261-
for (const auto pair : event.trigNameMap) {
261+
for (const auto& pair : event.trigNameMap) {
262262
std::cout << pair.first << ": " << event.triginfo._triggerArray[pair.second] << std::endl;
263263
}
264264

rooutil/inc/RooUtil.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public:
143143

144144
if(event->trkmcsim) { output_ntuple->Branch("trkmcsim", event->trkmcsim); }
145145

146-
for (const auto pair : event->trigNameMap) {
146+
for (const auto& pair : event->trigNameMap) {
147147
output_ntuple->Branch(pair.first.c_str(), &event->triginfo._triggerArray[pair.second]);
148148
}
149149

0 commit comments

Comments
 (0)