]> git.ipfire.org Git - thirdparty/git.git/commitdiff
diff-merges: cleanup func_by_opt()
authorSergey Organov <sorganov@gmail.com>
Wed, 14 Sep 2022 19:31:00 +0000 (22:31 +0300)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Sep 2022 16:21:40 +0000 (09:21 -0700)
Get rid of unneeded "else" statements in func_by_opt().

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-merges.c

index 7f64156b8bfec6bb5ec17038eee0d73c68487988..780ed08fc87f7c6955fe887b63de531f05fe5ecb 100644 (file)
@@ -60,15 +60,15 @@ static diff_merges_setup_func_t func_by_opt(const char *optarg)
                return suppress;
        if (!strcmp(optarg, "1") || !strcmp(optarg, "first-parent"))
                return set_first_parent;
-       else if (!strcmp(optarg, "separate"))
+       if (!strcmp(optarg, "separate"))
                return set_separate;
-       else if (!strcmp(optarg, "c") || !strcmp(optarg, "combined"))
+       if (!strcmp(optarg, "c") || !strcmp(optarg, "combined"))
                return set_combined;
-       else if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
+       if (!strcmp(optarg, "cc") || !strcmp(optarg, "dense-combined"))
                return set_dense_combined;
-       else if (!strcmp(optarg, "r") || !strcmp(optarg, "remerge"))
+       if (!strcmp(optarg, "r") || !strcmp(optarg, "remerge"))
                return set_remerge_diff;
-       else if (!strcmp(optarg, "m") || !strcmp(optarg, "on"))
+       if (!strcmp(optarg, "m") || !strcmp(optarg, "on"))
                return set_to_default;
        return NULL;
 }