From: Nguyễn Thái Ngọc Duy Date: Tue, 22 Jan 2019 00:30:20 GMT Subject: [PATCH v2 3/3] diff.c: simplify diff_opt_break_rewrites() Message-ID: <20190122003020.9672-4-pclouds@gmail.com> In-Reply-To: <20190122003020.9672-1-pclouds@gmail.com> Helped-by: Johannes Schindelin Signed-off-by: Nguyễn Thái Ngọc Duy --- 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, const char *arg, int unset) { int *break_opt = opt->value; - 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; - case '/': + if (*arg == '/') { arg++; opt2 = parse_rename_score(&arg); - break; } if (*arg != 0) return error(_("%s expects / form"), opt->long_name); -- 2.20.1.560.g70ca8b83ee