From: Jonas Fonseca Date: Mon, 9 Feb 2009 00:54:41 +0000 (+0100) Subject: Optimize read_repo_config_option to reduce string comparisons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b1fc02d40407a367f64c6bc3517e6e4b66ed0b51;p=tig.git Optimize read_repo_config_option to reduce string comparisons --- diff --git a/tig.c b/tig.c index b1804aa..9537208 100644 --- a/tig.c +++ b/tig.c @@ -6716,10 +6716,10 @@ read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen if (!strcmp(name, "i18n.commitencoding")) string_ncopy(opt_encoding, value, valuelen); - if (!strcmp(name, "core.editor")) + else if (!strcmp(name, "core.editor")) string_ncopy(opt_editor, value, valuelen); - if (!prefixcmp(name, "tig.color.")) + else if (!prefixcmp(name, "tig.color.")) set_repo_config_option(name + 10, value, option_color_command); else if (!prefixcmp(name, "tig.bind."))