trace2: remove dead code in maybe_add_string_va()
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 8 Aug 2019 14:19:01 +0000 (07:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2019 17:39:44 +0000 (10:39 -0700)
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>
trace2/tr2_tgt_event.c
trace2/tr2_tgt_normal.c
trace2/tr2_tgt_perf.c
index c2852d1bd2bd856d518b5ce499d38e7b13bb452c..9bcac20d1b5a3da6a996c85adbaf4eb19ffb9f15 100644 (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,
index 00b116d797c844cd7320542a9829e94ee1e0311c..47a18825573b634008069fbf4b09b9f4a95d53b2 100644 (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,
index fb845cb62774deb8b4a6324435c550c1846eb4cc..8e52395de2d1ba37d966891331b81355ae032c58 100644 (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,