From: Christian Couder Date: Sat, 16 Feb 2008 04:59:53 +0000 (+0100) Subject: diff.c: remove useless check for value != NULL X-Git-Tag: v1.5.4.2~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2c778210f8877e8f5c88715c2d25d1a43d976566;p=git.git diff.c: remove useless check for value != NULL It is not necessary to check if value != NULL before calling 'parse_lldiff_command' as there is already a check inside this function. By the way this patch also improves the existing check inside 'parse_lldiff_command' by using: return config_error_nonbool(var); instead of: return error("%s: lacks value", var); Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- diff --git a/diff.c b/diff.c index 047310fc9..ed41ce418 100644 --- a/diff.c +++ b/diff.c @@ -166,13 +166,8 @@ int git_diff_ui_config(const char *var, const char *value) if (!prefixcmp(var, "diff.")) { const char *ep = strrchr(var, '.'); - if (ep != var + 4) { - if (!strcmp(ep, ".command")) { - if (!value) - return config_error_nonbool(var); - return parse_lldiff_command(var, ep, value); - } - } + if (ep != var + 4 && !strcmp(ep, ".command")) + return parse_lldiff_command(var, ep, value); } return git_diff_basic_config(var, value);