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:
Jeff Hostetler 2019-08-08 07:19:01 -07:00 committed by Junio C Hamano
parent da4589ce7e
commit 04f10d332f
3 changed files with 0 additions and 15 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,