Skip to content

Commit baaebb7

Browse files
committed
making clang tidy happy
1 parent 044d291 commit baaebb7

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

include/reactor-cpp/graph.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public:
170170
std::string mermaid_string = "graph TD;\n";
171171

172172
auto name_resolver = [&](E object) -> std::string {
173-
char names[] = "ABCDEFGHIJKLMNOPQRSTUVGXYZabcdefghijklmnopqrstuvgxyz"; //NOLINT
173+
char names[] = "ABCDEFGHIJKLMNOPQRSTUVGXYZabcdefghijklmnopqrstuvgxyz"; // NOLINT
174174
if (name_map.find(object) == std::end(name_map)) {
175175
name_map[object] = names[index];
176176
index++;

lib/environment.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@
2424

2525
namespace reactor {
2626

27+
void vector_shuffle(std::vector<std::pair<ConnectionProperties, BasePort*>>& path, BasePort* source) {
28+
for (auto it = std::begin(path); it != std::end(path); ++it) {
29+
if (std::next(it) == std::end(path)) {
30+
it->second = source;
31+
} else {
32+
it->second = std::next(it)->second;
33+
}
34+
}
35+
};
36+
2737
Environment::Environment(unsigned int num_workers, bool fast_fwd_execution, const Duration& timeout)
2838
: log_("Environment")
2939
, num_workers_(num_workers)
@@ -155,13 +165,7 @@ void Environment::expand_and_merge() {
155165
std::reverse(path.begin(), path.end());
156166

157167
auto* previous_element = std::begin(path)->second;
158-
for (auto it = std::begin(path); it != std::end(path); ++it) {
159-
if (std::next(it) == std::end(path)) {
160-
it->second = source;
161-
} else {
162-
it->second = std::next(it)->second;
163-
}
164-
}
168+
vector_shuffle(path, source);
165169

166170
auto current_rating = previous_element->rating();
167171

0 commit comments

Comments
 (0)