Commit aaced3c3 authored by neverlord's avatar neverlord

tuned filter function

parent 04ddeb67
......@@ -63,11 +63,13 @@ enum filter_result
yielding_message_queue_impl::filter_result
yielding_message_queue_impl::filter_msg(const any_tuple& msg)
{
if ( m_trap_exit == false
&& msg.size() == 2
&& m_atom_value_uti == &(msg.utype_info_at(0)))
if (msg.size() == 2 && m_atom_value_uti == &(msg.utype_info_at(0)))
{
if (*reinterpret_cast<const atom_value*>(msg.at(0)) == atom(":Exit"))
switch ((std::uint64_t) *reinterpret_cast<const atom_value*>(msg.at(0)))
{
case atom(":Exit"):
{
if (m_trap_exit == false)
{
if (m_ui32_uti == &(msg.utype_info_at(1)))
{
......@@ -79,10 +81,9 @@ yielding_message_queue_impl::filter_msg(const any_tuple& msg)
return normal_exit_signal;
}
}
break;
}
if ( msg.size() == 2
&& m_atom_value_uti == &(msg.utype_info_at(0))
&& atom(":Timeout") == *reinterpret_cast<const atom_value*>(msg.at(0)))
case atom(":Timeout"):
{
if (m_ui32_uti == &(msg.utype_info_at(1)))
{
......@@ -90,6 +91,10 @@ yielding_message_queue_impl::filter_msg(const any_tuple& msg)
return (id == m_active_timeout_id) ? timeout_message
: expired_timeout_message;
}
break;
}
default: break; /* nop */
}
}
return ordinary_message;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment