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 4032199
Showing 1 changed file with 11 additions and 7 deletions.
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;
}
}
shuffle(path, source);

auto current_rating = previous_element->rating();

Expand Down

0 comments on commit 4032199

Please sign in to comment.