File tree 1 file changed +11
-7
lines changed
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 24
24
25
25
namespace reactor {
26
26
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
+
27
37
Environment::Environment (unsigned int num_workers, bool fast_fwd_execution, const Duration & timeout)
28
38
: log_(" Environment" )
29
39
, num_workers_(num_workers)
@@ -155,13 +165,7 @@ void Environment::expand_and_merge() {
155
165
std::reverse (path.begin (), path.end ());
156
166
157
167
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);
165
169
166
170
auto current_rating = previous_element->rating ();
167
171
You can’t perform that action at this time.
0 commit comments