@matheusbsbs / matheus-bagliano / commits / 16538bfd2c
Fork 0

bisect--helper: convert `vocab_*` char pointers to char arrays

Instead of using a pointer that points at a constant string, just give name directly to the constant string; this way, we do not have to allocate a pointer variable in addition to the string we want to use. Let's convert `vocab_bad` and `vocab_good` char pointers to char arrays. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Miriam Rubio <mirucam@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Miriam Rubio committed Feb 17, 2020 at 09:40 UTC 16538bfd2c429a81a86011f32afa189047afd6e5
1 file changed +2 -2
builtin/bisect--helper.c
+2 -2
@@ -52,8 +52,8 @@ static void set_terms(struct bisect_terms *terms, const char *bad,
52 terms->term_bad = xstrdup(bad);
53 }
54
55 -static const char *vocab_bad = "bad|new";
56 -static const char *vocab_good = "good|old";
55 +static const char vocab_bad[] = "bad|new";
56 +static const char vocab_good[] = "good|old";
57
58 /*
59 * Check whether the string `term` belongs to the set of strings