Commit 2b073262 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

twa_graph: simplify two precondition checks

* spot/twa/twagraph.hh (state_acc_sets, state_is_accepting): Do not
check num_sets()==0 since this would imply prop_state_acc().
parent 034620c5
...@@ -469,7 +469,7 @@ namespace spot ...@@ -469,7 +469,7 @@ namespace spot
acc_cond::mark_t state_acc_sets(unsigned s) const acc_cond::mark_t state_acc_sets(unsigned s) const
{ {
if (SPOT_UNLIKELY(!((bool)prop_state_acc() || num_sets() == 0))) if (SPOT_UNLIKELY(!(bool)prop_state_acc()))
throw std::runtime_error throw std::runtime_error
("state_acc_sets() should only be called on " ("state_acc_sets() should only be called on "
"automata with state-based acceptance"); "automata with state-based acceptance");
...@@ -483,7 +483,7 @@ namespace spot ...@@ -483,7 +483,7 @@ namespace spot
bool state_is_accepting(unsigned s) const bool state_is_accepting(unsigned s) const
{ {
if (SPOT_UNLIKELY(!((bool)prop_state_acc() || num_sets() == 0))) if (SPOT_UNLIKELY(!(bool)prop_state_acc()))
throw std::runtime_error throw std::runtime_error
("state_is_accepting() should only be called on " ("state_is_accepting() should only be called on "
"automata with state-based acceptance"); "automata with state-based acceptance");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment