From b1fc02d40407a367f64c6bc3517e6e4b66ed0b51 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Mon, 9 Feb 2009 01:54:41 +0100 Subject: [PATCH] Optimize read_repo_config_option to reduce string comparisons --- tig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.")) -- 2.30.2