Re:Clearer Conditionals using De Morgan's Laws
by ChuckMcM on Friday December 20, 2013 @06:20PM
(#6944804)
This is a nice structure, It also suggests something like closures where you inverse stacked the functions and did something like:
int do_command(sdio_command_chain *cmd) {
int err = 0;
if (cmd->next) {
err = do_command(cmd->next);
}
return (err) ? err : call_command(cmd->parms);
}
Thanks for that!
The sample code I first looked at was doing Goto's to the exit code (deselect/return error) which was unacceptable :-).
What's so bad about a little goto between friends?