} else {
/* we need a sleep action (even when the timeout is infinite) to be notified of host failures */
/* Comms handle that a bit differently of the other activities */
- auto* comm = dynamic_cast<CommImpl*>(this);
- if (comm != nullptr) {
+ if (auto* comm = dynamic_cast<CommImpl*>(this)) {
resource::Action* sleep = issuer->get_host()->get_cpu()->sleep(timeout);
sleep->set_activity(comm);
std::string ActivityTestSimcall::to_string(int times_considered) const
{
std::string res = SimcallObserver::to_string(times_considered) + "Test ";
- auto* comm = dynamic_cast<activity::CommImpl*>(activity_);
- if (comm) {
+ if (const auto* comm = dynamic_cast<activity::CommImpl*>(activity_)) {
if (comm->src_actor_.get() == nullptr || comm->dst_actor_.get() == nullptr) {
res += "FALSE(comm=";
res += XBT_LOG_ISENABLED(mc_observer, xbt_log_priority_verbose) ? xbt::string_printf("%p)", comm)