Thread (1 message) 1 message, 1 author, 2019-01-22

Re: [PATCH 3/3] diff.c: simplify diff_opt_break_rewrites()

From: Junio C Hamano <hidden>
Date: 2019-01-22 23:18:23

Junio C Hamano [off-list ref] writes:
It would make it even easier to follow if you did

	if (*arg == '/') {
		opt2 = ...;
		arg++;
	} else {
Oops, this should read "else if (!*arg) {", of course, to match the
original.  Sorry for the noise.
		opt2 = 0;
	}
And then we'd want a blank line here to make it clear that the
previous if/else cascade has finished, and the error checking we see
next is not part of it.
	if (*arg)
		return error(...);

It makes it clear that opt2==0 means <n> form and not <n>/<m> form,
by having an explicit assignment while we parse what *arg points at,
without the initialization to 0 in the variable definition.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help