Skip to content

Commit

Permalink
test build on MacOs
Browse files Browse the repository at this point in the history
  • Loading branch information
qindazhu committed Apr 25, 2020
1 parent 49759d2 commit d5002b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Test
shell: bash
working-directory: ${{runner.workspace}}/build
run: ctest --build-config $BUILD_TYPE
run: CTEST_OUTPUT_ON_FAILURE=1 ctest --build-config $BUILD_TYPE
12 changes: 6 additions & 6 deletions k2/csrc/properties.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ bool IsConnected(const Fsa &fsa) {
return false;

// reuse `accessible` to process co-accessible situation.
std::fill(accessible.begin(), accessible.end(), false);
accessible[num_states - 1] = true; // the final state
std::vector<bool> co_accessible(num_states, false);
co_accessible[num_states - 1] = true; // the final state
for (int32_t i = num_states - 1; i >= 0; --i) {
const auto &arc = fsa.arcs[i];
if (!accessible[arc.dest_state]) return false;
accessible[arc.src_state] = true;
if (!co_accessible[arc.dest_state]) return false;
co_accessible[arc.src_state] = true;
}
return std::find(accessible.begin(), accessible.end(), false) ==
accessible.end();
return std::find(co_accessible.begin(), co_accessible.end(), false) ==
co_accessible.end();
}
} // namespace k2

0 comments on commit d5002b9

Please sign in to comment.