Skip to content

Commit c026418

Browse files
peffgitster
authored andcommitted
avoid using skip_prefix as a boolean
There's no point in using: if (skip_prefix(buf, "foo")) over if (starts_with(buf, "foo")) as the point of skip_prefix is to return a pointer to the data after the prefix. Using starts_with is more readable, and will make refactoring skip_prefix easier. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1055a89 commit c026418

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/fmt-merge-msg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static void credit_people(struct strbuf *out,
298298
(them->nr == 1 &&
299299
me &&
300300
(me = skip_prefix(me, them->items->string)) != NULL &&
301-
skip_prefix(me, " <")))
301+
starts_with(me, " <")))
302302
return;
303303
strbuf_addf(out, "\n%c %s ", comment_line_char, label);
304304
add_people_count(out, them);

0 commit comments

Comments
 (0)