mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
trace2: remove dead code in maybe_add_string_va()
Remove an unnecessary "if" block in maybe_add_string_va(). Commit "ad006fe419e trace2: NULL is not allowed for va_list" changed "if (fmt && *fmt && ap)" to just "if (fmt && *fmt)" because it isn't safe to treat 'ap' as a pointer. This made the "if" block following it unnecessary. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
da4589ce7e
commit
04f10d332f
|
@ -205,11 +205,6 @@ static void maybe_add_string_va(struct json_writer *jw, const char *field_name,
|
|||
strbuf_release(&buf);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt && *fmt) {
|
||||
jw_object_string(jw, field_name, fmt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void fn_error_va_fl(const char *file, int line, const char *fmt,
|
||||
|
|
|
@ -135,11 +135,6 @@ static void maybe_append_string_va(struct strbuf *buf, const char *fmt,
|
|||
va_end(copy_ap);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt && *fmt) {
|
||||
strbuf_addstr(buf, fmt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void fn_error_va_fl(const char *file, int line, const char *fmt,
|
||||
|
|
|
@ -239,11 +239,6 @@ static void maybe_append_string_va(struct strbuf *buf, const char *fmt,
|
|||
va_end(copy_ap);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt && *fmt) {
|
||||
strbuf_addstr(buf, fmt);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void fn_error_va_fl(const char *file, int line, const char *fmt,
|
||||
|
|
Loading…
Reference in a new issue