Thread (4 messages) 4 messages, 4 authors, 2017-01-16

Re: [PATCH v3 01/38] sequencer: avoid unnecessary curly braces

flat view

From: Junio C Hamano <hidden>
Date: 2017-01-12 18:35:45

Johannes Schindelin [off-list ref] writes:
quoted hunk
 
-	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 ...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help