Re: [PATCH v3 01/38] sequencer: avoid unnecessary curly braces
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2017, 18:35 UTC
- Message-ID
- <xmqqk2a0ktxr.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <bc1a6c21c9ab2f55882c363e802bfcf37e49d79f.1483370556.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 8 quoted lines
>
> - if (!commit->parents) {
> + if (!commit->parents)
> parent = NULL;
> - }
> else if (commit->parents->next) {
> /* Reverting or cherry-picking a merge commit */
> int cnt;The result becomes
if (...)
single statement;
else if (...) {
multiple;
statements;
}which is not quite an improvement.
The preferred style is for all arms in if/elseif/else cascade to either use or not use brace pairs, so I think a fix toward that goal would be more like:
if (!commit->parents) {
parent = NULL;
- }
- else if (commit->parents->next) {
+ } else if (commit->parents->next) {
/* Reverting ...