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

2019-01-22 Thread Junio C Hamano
Junio C Hamano 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 =

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

2019-01-22 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > - int opt1, opt2; > + int opt1, opt2 = 0; > > BUG_ON_OPT_NEG(unset); > if (!arg) > arg = ""; > opt1 = parse_rename_score(&arg); > - switch (*arg) { > - case '\0': > - opt2 = 0; > - break; > -

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

2019-01-21 Thread Nguyễn Thái Ngọc Duy
Helped-by: Johannes Schindelin --- diff.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/diff.c b/diff.c index da5ba835ce..2351571251 100644 --- a/diff.c +++ b/diff.c @@ -4814,20 +4814,15 @@ static int diff_opt_break_rewrites(const struct option *opt,