[Kamailio-Devel] Use of goto

Alex Balashov abalashov at evaristesys.com
Tue Jan 27 22:45:09 CET 2009


Raúl Alexis Betancor Santana wrote:
> El Martes, 27 de Enero de 2009 21:13, Daniel Corbe escribió:
>> You should read http://kerneltrap.org/node/553/2131
>> There's plenty of cases where goto is justified and certainly branching out
>> into error conditions is one of them.  At least on the intel architecture
>> goto typically translates 1:1 to the jmp instruction and is monumentally
>> more efficient than constructing complex and hard to understand loops.
> 
> Goto statements should be avoided, it's not a matter of how much time it takes 
> to "goto", it's a matter readability of the code
> 

Except where performance really matters.

In the case of error handling of atypical situations, probably not very 
important.

In the case of something that is inline to the core's processing of 
every request, on the other hand...

-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775



More information about the Devel mailing list