|
|
|
|
|
by xfax
4703 days ago
|
|
I agree, having a single return point makes debugging that much easier. Back at Microsoft, the following pattern was used quite extensively in the OS group: int someFunc() {
DWORD error = ERROR_SUCCESS;
error = foo();
if (error != ERROR_SUCCESS) {
goto Clean0;
}
error = bar();
if (error != ERROR_SUCCESS) {
goto Clean0;
}
....
Clean0:
return error;
}
|
|