@matheusbsbs / matheus-bagliano / commits / 2c778210f8
Fork 0

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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Feb 16, 2008 at 05:59 UTC 2c778210f8877e8f5c88715c2d25d1a43d976566
1 file changed +2 -7
diff.c
+2 -7
@@ -166,13 +166,8 @@ int git_diff_ui_config(const char *var, const char *value)
166 if (!prefixcmp(var, "diff.")) {
167 const char *ep = strrchr(var, '.');
168
169 - if (ep != var + 4) {
170 - if (!strcmp(ep, ".command")) {
171 - if (!value)
172 - return config_error_nonbool(var);
173 - return parse_lldiff_command(var, ep, value);
174 - }
175 - }
169 + if (ep != var + 4 && !strcmp(ep, ".command"))
170 + return parse_lldiff_command(var, ep, value);
171 }
172
173 return git_diff_basic_config(var, value);