Decompilation should prioritize early returns
What is the feature you'd like to have? The the structure of a function's decompilation could be improved by prioritizing early returns in cases like the following:
Current decompilation:
void foo(...) {
if (argX != 0) {
// here is whole function body
}
return
}
Preferred decompilation:
void foo(...) {
if (argX == 0) {
return
}
// function body
}
Additional Information: Question came from @mostobriv on the public slack, with the following text:
is restructuring occurs only when there is multiple expressions in if block? i've got bunch of examples when i've got nesting of the whole function instead of just early return, with the new option enabled of course.
From Matt Wiseman on public slack:
Would it be feasible to extend this solution to a new context-menu option on conditionals that allows for inverting and reordering arbitrary conditional scopes, not just in the case of early returns?
Early returns are already part of the optimization process, but there was a bug. This will be fixed soon.
Fixed in 5.1.7555