Removed a further simple trampoline.

This commit is contained in:
Cas Cremers 2018-10-19 15:10:28 -04:00
parent 128189bb54
commit ad06600bd8

View File

@ -31,15 +31,15 @@
extern Term TERM_Hidden; extern Term TERM_Hidden;
//! hide level within protocol //! Helper for HideLevel
unsigned int unsigned int
protocolHidelevel (const System sys, const Term t) minlevel_itsends (const Protocol p, const Role r, const Term t)
{ {
Roledef rd;
unsigned int minlevel; unsigned int minlevel;
int itsends (const Protocol p, const Role r) minlevel = UINT_MAX;
{ for (rd = r->roledef; rd != NULL; rd = rd->next)
int sends (Roledef rd)
{ {
if (rd->type == SEND) if (rd->type == SEND)
{ {
@ -55,15 +55,33 @@ protocolHidelevel (const System sys, const Term t)
if (l < minlevel) if (l < minlevel)
minlevel = l; minlevel = l;
} }
return true; }
return minlevel;
} }
roledef_iterate_events (r->roledef, sends); //! hide level within protocol
return true; unsigned int
} protocolHidelevel (const System sys, const Term t)
{
unsigned int minlevel;
Protocol p;
minlevel = INT_MAX; minlevel = UINT_MAX;
iterateRoles (sys, itsends); for (p = sys->protocols; p != NULL; p = p->next)
{
Role r;
for (r = p->roles; r != NULL; r = r->next)
{
unsigned int ml;
ml = minlevel_itsends (p, r, t);
if (ml < minlevel)
{
minlevel = ml;
}
}
}
return minlevel; return minlevel;
} }