File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 2424
2525namespace 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+
2737Environment::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
You can’t perform that action at this time.
0 commit comments