2 ms·
GOTO in a C/C++ world is actually a fairly efficient way to manage the exit points of your function. If you're carefully managing memory, putting all of your m
by eamann 14y ago
GOTO in a C/C++ world is actually a fairly efficient way to manage the exit points of your function. If you're carefully managing memory, putting all of your method cleanup code in one place and directing logic there with a GOTO is more efficient that releasing memory at several different locations within your method.
At the same time, if your methods are complicated enough to possibly require multiple exit points, I'd argue that they should be refactored and broken apart a bit more.