Skip to content

Commit

Permalink
Better way to get the largest module ID
Browse files Browse the repository at this point in the history
  • Loading branch information
makortel committed Dec 7, 2020
1 parent d85160d commit abd449d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions HLTrigger/Timer/src/ProcessCallGraph.cc
Expand Up @@ -4,7 +4,6 @@

#include <cassert>
#include <iostream>
#include <numeric>
#include <string>
#include <type_traits>
#include <vector>
Expand Down Expand Up @@ -73,13 +72,7 @@ void ProcessCallGraph::preBeginJob(edm::PathsAndConsumesOfModulesBase const& pat
boost::get_property(graph, boost::graph_name) = context.processName();

// create graph vertices associated to all modules in the process
unsigned int size = 0;
if (auto const& allModules = pathsAndConsumes.allModules(); not allModules.empty()) {
size = std::accumulate(
allModules.begin(), allModules.end(), size, [](unsigned int s, edm::ModuleDescription const* module) {
return std::max(s, module->id());
});
}
unsigned int size = pathsAndConsumes.largestModuleID() - boost::num_vertices(graph) + 1;;
for (size_t i = 0; i < size; ++i)
boost::add_vertex(graph);

Expand Down

0 comments on commit abd449d

Please sign in to comment.