C++ inline vs. method

SirNickity, I might not have 30 years, but after 11 I can instantly see that exceptions are the logical answer to that solution. Its just a quick and dirty hack that can be exceptionally bad when used incorrect, of course if used well it may save a cycle or two, but that's about it. I know Arduino does not support exceptions, but wait there is more...

In fact as the goto label is executed before return, regardless of goto, the loops can be controlled with break and continue. A classic method of doing a function like that is using tail recursion.

Anywhere you use goto is a clear indicator that the higher level design is flawed, one single function may not be to blame, it could be an amalgamation your entire project.

Consider this:

if (rval != ERR_OK) goto cleanup;
//while loop is next.

This would only be equal to, never faster than simply putting the entire while loop inside the if:

if (rval == ERR_OK){
//While loop here
}

Obviously this programmer simply likes using goto, and has not put substantial thought into a correct and logical program flow.