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().
This commit is contained in:
Alexandre Duret-Lutz 2016-11-29 22:26:35 +01:00
parent 034620c521
commit 2b07326217

View file

@ -469,7 +469,7 @@ namespace spot
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
("state_acc_sets() should only be called on "
"automata with state-based acceptance");
@ -483,7 +483,7 @@ namespace spot
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
("state_is_accepting() should only be called on "
"automata with state-based acceptance");