From 75450307c0c5a0fdf9826e5b06bdf252cfe22df0 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 20:14:48 -1000 Subject: Trim the comments and dead code across the tree --- source/parsing.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/parsing.c') diff --git a/source/parsing.c b/source/parsing.c index de2798a..745bbba 100644 --- a/source/parsing.c +++ b/source/parsing.c @@ -77,9 +77,6 @@ static const char *reencode(char **text, const char *from, const char *to) { char *converted; - if (!text) - return NULL; - if (!*text || !from || !to) return *text; @@ -160,7 +157,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) while (skip_prefix(p, "parent ", &p)) p += the_hash_algo->hexsz + 1; - if (p && skip_prefix(p, "author ", &p)) { + if (skip_prefix(p, "author ", &p)) { parse_user(p, &info->author, &info->author_email, &info->author_date, &info->author_tz); p = next_header_line(p); @@ -197,10 +194,8 @@ struct commitinfo *cgit_parse_commit(struct commit *commit) eol++; info->msg = xstrdup(eol); } else { - // Reached when an object is truncated mid header, which - // leaves nothing at all after them. Callers render subject - // and msg as text without checking, so they get empty - // strings rather than NULL. + // An object truncated mid header leaves nothing after it, + // and callers render subject and msg without NULL checks. info->subject = xstrdup(""); info->msg = xstrdup(""); } -- cgit v2.8.0