@ben What are your thoughts on multiple returns vs. enforcing a single return from a function?
Does one style produce a better compiled application than the other:
Style 1:
int foo ( int p1 )
{
int result = 0;
if (p1 < 1)
{
return result;
}
if(p1 > 0 && p1 < 32)
{
result = 1;
}
if(p1 > 31 && p1 < 127)
{
result = 2;
}
if(p1 > 126)
{
result = 3;
}
return result;
}
or
Style 2:
int foo ( int p1 )
{
if (p1 < 1)
{
return 0;
}
if(p1 > 0 && p1 < 32)
{
return 1;
}
if(p1 > 31 && p1 < 127)
{
return 2;
}
if(p1 > 126)
{
return 3;
}
}
Thanks