Skip to content

Commit

Permalink
Cleanup setup code slightly to avoid unnecessary copies
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored and kjvbrt committed Aug 28, 2024
1 parent 1e1677c commit b059d23
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/DataSource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ void DataSource::SetupInput(int nEvents) {
frame = podioReader.readFrame(podio::Category::Event, 0);

// Determine over how many events to run
if (nEventsInFiles > 0) {
} else {
if (nEventsInFiles <= 0) {
throw std::runtime_error("podio::DataSource: No events found!");
}

Expand All @@ -57,10 +56,10 @@ void DataSource::SetupInput(int nEvents) {

// Get collections stored in the files
std::vector<std::string> collNames = frame.getAvailableCollections();
for (const auto& collName : collNames) {
for (auto&& collName : collNames) {
const podio::CollectionBase* coll = frame.get(collName);
if (coll->isValid()) {
m_columnNames.emplace_back(collName);
m_columnNames.emplace_back(std::move(collName));
m_columnTypes.emplace_back(coll->getTypeName());
}
}
Expand Down

0 comments on commit b059d23

Please sign in to comment.