summaryrefslogtreecommitdiff
path: root/trace2
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2019-08-08 14:19:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-08 17:39:44 (GMT)
commit04f10d332f47aed7d93ff3ed5c2bb3a366e44693 (patch)
tree779d19cff88e2ab2a2a3022c581f606a21c24048 /trace2
parentda4589ce7ecb84b51b2819542f9555848dccf726 (diff)
downloadgit-04f10d332f47aed7d93ff3ed5c2bb3a366e44693.zip
git-04f10d332f47aed7d93ff3ed5c2bb3a366e44693.tar.gz
git-04f10d332f47aed7d93ff3ed5c2bb3a366e44693.tar.bz2
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>
Diffstat (limited to 'trace2')
-rw-r--r--trace2/tr2_tgt_event.c5
-rw-r--r--trace2/tr2_tgt_normal.c5
-rw-r--r--trace2/tr2_tgt_perf.c5
3 files changed, 0 insertions, 15 deletions
diff --git a/trace2/tr2_tgt_event.c b/trace2/tr2_tgt_event.c
index c2852d1..9bcac20 100644
--- a/trace2/tr2_tgt_event.c
+++ b/trace2/tr2_tgt_event.c
@@ -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,
diff --git a/trace2/tr2_tgt_normal.c b/trace2/tr2_tgt_normal.c
index 00b116d..47a1882 100644
--- a/trace2/tr2_tgt_normal.c
+++ b/trace2/tr2_tgt_normal.c
@@ -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,
diff --git a/trace2/tr2_tgt_perf.c b/trace2/tr2_tgt_perf.c
index fb845cb..8e52395 100644
--- a/trace2/tr2_tgt_perf.c
+++ b/trace2/tr2_tgt_perf.c
@@ -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,