X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cef6554994ae17d8f56c9245ad2c10c7cf39af8c..3f9b311ec56db95ec539001a860ae3c838c48312:/src/mc/transition/TransitionActor.cpp diff --git a/src/mc/transition/TransitionActor.cpp b/src/mc/transition/TransitionActor.cpp index 16a17a3d09..3e1027b576 100644 --- a/src/mc/transition/TransitionActor.cpp +++ b/src/mc/transition/TransitionActor.cpp @@ -49,18 +49,14 @@ bool ActorJoinTransition::depends(const Transition* other) const bool ActorJoinTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::ACTOR_JOIN: - // ActorJoin races with another event iff its target `T` is the same as - // the actor executing the other transition. Clearly, then, we could not join - // on that actor `T` and then run a transition by `T`, so no race is reversible - return false; - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::ACTOR_JOIN, "Unexpected transition type %s", to_c_str(type_)); + + // ActorJoin races with another event iff its target `T` is the same as the actor executing the other transition. + // Clearly, then, we could not join on that actor `T` and then run a transition by `T`, so no race is reversible + return false; } -ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream& stream) +ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream&) : Transition(Type::ACTOR_SLEEP, issuer, times_considered) { XBT_DEBUG("ActorSleepTransition()"); @@ -81,12 +77,9 @@ bool ActorSleepTransition::depends(const Transition* other) const bool ActorSleepTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::ACTOR_SLEEP: - return true; // Always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::ACTOR_SLEEP, "Unexpected transition type %s", to_c_str(type_)); + + return true; // Always enabled } } // namespace simgrid::mc