Skip to content

Commit 25c924b

Browse files
committed
Simplify locations generation in get_sparse_matrices.
1 parent 67cdb1a commit 25c924b

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

src/routing/wrapper.h

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,22 @@ class Wrapper {
5252
route_locs.reserve(v.steps.size());
5353

5454
bool has_job_steps = false;
55+
56+
if (v.has_start()) {
57+
route_locs.push_back(v.start.value());
58+
}
59+
5560
for (const auto& step : v.steps) {
56-
switch (step.type) {
57-
using enum STEP_TYPE;
58-
case START:
59-
if (v.has_start()) {
60-
route_locs.push_back(v.start.value());
61-
}
62-
break;
63-
case END:
64-
if (v.has_end()) {
65-
route_locs.push_back(v.end.value());
66-
}
67-
break;
68-
case BREAK:
69-
break;
70-
case JOB:
61+
if (step.type == STEP_TYPE::JOB) {
7162
has_job_steps = true;
7263
route_locs.push_back(jobs[step.rank].location);
73-
break;
7464
}
7565
}
7666

67+
if (v.has_end()) {
68+
route_locs.push_back(v.end.value());
69+
}
70+
7771
if (has_job_steps) {
7872
assert(route_locs.size() >= 2);
7973

0 commit comments

Comments
 (0)