Skip to content

Commit

Permalink
tf's review
Browse files Browse the repository at this point in the history
  • Loading branch information
kilohsakul committed Sep 28, 2023
1 parent a375fd1 commit 03e911d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nfa/intersection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Nfa intersection(const Nfa& lhs, const Nfa& rhs, const Symbol first_epsilon, Pro
return lhs.final.contains(lhs_state) && rhs.final.contains(rhs_state);
};

if (lhs.final.empty() || lhs.initial.empty() || rhs.initial.empty() || rhs.final.empty())
return Nfa{};

return algorithms::product(lhs, rhs, both_final, first_epsilon, prod_map);
}

Expand Down

0 comments on commit 03e911d

Please sign in to comment.