4 ms·
Of course in this case you can avoid both the repetition and the goto at the cost of more nesting: rv = -1; a = open(...); if (a) { b = open(...);
by tzs 10y ago
Of course in this case you can avoid both the repetition and the goto at the cost of more nesting:
rv = -1;
a = open(...);
if (a) {
b = open(...);
if (b) {
c = open(...);
if (c) {
rv = something(a,b,c);
close(c);
}
close(b);
}
close(a);
}
return rv;
I wonder if there is some sort of program organization analog of Heisenberg's uncertainty principle, where the product of some measure of repetition, some measure of non-structured jumping, and some measure of nesting must be greater than a certain value?