From 2b073262176d7cef42e15bc0756263b1fc403d64 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 29 Nov 2016 22:26:35 +0100 Subject: [PATCH] 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(). --- spot/twa/twagraph.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spot/twa/twagraph.hh b/spot/twa/twagraph.hh index 1acd66fbe..6ee124266 100644 --- a/spot/twa/twagraph.hh +++ b/spot/twa/twagraph.hh @@ -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");