[Lldb-commits] [PATCH] D55574: Remove else statements after returns

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 11 18:43:33 PST 2018


jingham added a comment.

When one or the other side of the if/else test is trivial, then this rewrite is fine.  When both the if and the else have a decent bit of code in them, however, removing the "} else {" and the concluding "}" obscures the fact that these are two coequal branches in the code.  Before, regardless of whether I'm reading from the bottom of the function up or the top down, the structure is obvious.  But when the else removed, particularly when reading from the bottom up, I can't tell this till I get to the } which happens to have a return just before it to know that.  So that sort of change doesn't improve readability to my mind.


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55574/new/

https://reviews.llvm.org/D55574





More information about the lldb-commits mailing list