Skip to content

Commit

Permalink
making clang tidy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Aug 21, 2023
1 parent 044d291 commit baaebb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/reactor-cpp/graph.hh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public:
std::string mermaid_string = "graph TD;\n";

auto name_resolver = [&](E object) -> std::string {
char names[] = "ABCDEFGHIJKLMNOPQRSTUVGXYZabcdefghijklmnopqrstuvgxyz"; //NOLINT
char names[] = "ABCDEFGHIJKLMNOPQRSTUVGXYZabcdefghijklmnopqrstuvgxyz"; // NOLINT
if (name_map.find(object) == std::end(name_map)) {
name_map[object] = names[index];
index++;
Expand Down
18 changes: 11 additions & 7 deletions lib/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@

namespace reactor {

void vector_shuffle(std::vector<std::pair<ConnectionProperties, BasePort*>>& path, BasePort* source) {
for (auto it = std::begin(path); it != std::end(path); ++it) {
if (std::next(it) == std::end(path)) {
it->second = source;
} else {
it->second = std::next(it)->second;
}
}
};

Environment::Environment(unsigned int num_workers, bool fast_fwd_execution, const Duration& timeout)
: log_("Environment")
, num_workers_(num_workers)
Expand Down Expand Up @@ -155,13 +165,7 @@ void Environment::expand_and_merge() {
std::reverse(path.begin(), path.end());

auto* previous_element = std::begin(path)->second;
for (auto it = std::begin(path); it != std::end(path); ++it) {
if (std::next(it) == std::end(path)) {
it->second = source;
} else {
it->second = std::next(it)->second;
}
}
vector_shuffle(path, source);

auto current_rating = previous_element->rating();

Expand Down

0 comments on commit baaebb7

Please sign in to comment.