/** @brief Returns the process from PID. */
smx_actor_t SIMIX_process_from_PID(aid_t PID)
{
- if (simix_global->process_list.find(PID) == simix_global->process_list.end())
+ try {
+ return simix_global->process_list.at(PID);
+ } catch (std::out_of_range& unfound) {
return nullptr;
- return simix_global->process_list.at(PID);
+ }
}
/** @brief returns a dynar containing all currently existing processes */