From fc3e6c40ec4efc13885124999d69cc661423552b Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Sun, 17 Jul 2022 09:34:03 +0200 Subject: [PATCH] Optimization --- src/configfile.c | 6 ++---- src/options.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index 2eb7b18..6eaa96a 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -219,14 +219,12 @@ static int data_handler(void *user, const char *section, const char *name, // Ignore return 0; } - - if (!strcmp(value, "none")) + else if (!strcmp(value, "none")) { option.color = -1; // No color return 0; } - - if (!strcmp(value, "bold")) + else if (!strcmp(value, "bold")) { option.color = 256; // Bold return 0; diff --git a/src/options.c b/src/options.c index 5ab47da..f89fcab 100644 --- a/src/options.c +++ b/src/options.c @@ -330,14 +330,12 @@ void options_parse(int argc, char *argv[]) } exit(EXIT_SUCCESS); } - - if (!strcmp(optarg, "none")) + else if (!strcmp(optarg, "none")) { option.color = -1; // No color break; } - - if (!strcmp(optarg, "bold")) + else if (!strcmp(optarg, "bold")) { option.color = 256; // Bold break;