> Il GOTO in C io lo ho sempre considerato una bestemmia. > > Si vede che non hai mai gestito gli errori. :) > > Riscrivi una funzione come questa <http://tinyurl.com/2esxn2q> senza usare > goto e valuta se il risultato รจ migliore. Codice limitato a 80 colonne, > prego. >
554 if (!(egtrid = PyObject_CallFunction(group, "i", 2))) { goto exit; } 555 if (!(gtrid = _xid_decode64(egtrid))) { goto exit; } 557 if (!(ebqual = PyObject_CallFunction(group, "i", 3))) { goto exit; } 558 if (!(bqual = _xid_decode64(ebqual))) { goto exit; } 560 /* Try to build the xid with the parsed material */ 561 rv = (XidObject *)PyObject_CallFunctionObjArgs((PyObject *)&XidType, 562 format_id, gtrid, bqual, NULL); /* Versione modificata */ 554 if (!(egtrid = PyObject_CallFunction(group,"i",2))) 555 { 556 fn_exit( rv, egtrid, ebqual, gtrid, egtrid, format_id, item, group, m ); 557 } 558 if (!(gtrid = _xid_decode64(egtrid))) 559 { 560 fn_exit( rv, egtrid, ebqual, gtrid, egtrid, format_id, item, group, m ); 561 } 562 if (!(ebqual = PyObject_CallFunction(group, "i", 3))) 563 { 564 fn_exit( rv, egtrid, ebqual, gtrid, egtrid, format_id, item, group, m ); 565 } 566 if (!(bqual = _xid_decode64(ebqual))) 567 { 568 fn_exit( rv, egtrid, ebqual, gtrid, egtrid, format_id, item, group, m ); 569 } 570 /* Try to build the xid with the parsed material */ 571 rv = (XidObject *)PyObject_CallFunctionObjArgs((PyObject *)&XidType, 572 format_id, gtrid, bqual, NULL); ... PyObject fn_exit( rv, egtrid, ebqual, gtrid, egtrid, format_id, item, group, m ) ... { ... Py_XDECREF(bqual); Py_XDECREF(ebqual); Py_XDECREF(gtrid); Py_XDECREF(egtrid); Py_XDECREF(format_id); Py_XDECREF(item); Py_XDECREF(group); Py_XDECREF(m); return rv; ... } Non e' piu' pulito cosi? Greetings JOKER Ltd. -- Ho guardato in alto, oltre le insegne illuminate e, obliqua su un grattacielo, c'era la luna. Le ho detto: "Cosa ci fa una ragazza come te in un posto come questo?" (*Stefano Benni* - Baol )
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python