diff options
author | René Scharfe <l.s.r@web.de> | 2019-08-25 19:44:10 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-26 11:34:23 -0700 |
commit | 1fd881d4046fb42f77ff9031ef07b7a18028ece0 (patch) | |
tree | 4ee63f162ed2d7ee7fce2c6741c2c4ae6772fc51 /trace2 | |
parent | trace2: use system/global config for default trace2 settings (diff) | |
download | tgif-1fd881d4046fb42f77ff9031ef07b7a18028ece0.tar.xz |
trace2: use warning() directly in tr2_dst_malformed_warning()
Let warning() format the message instead of using an intermediate strbuf
for that. This is shorter, easier to read and avoids an allocation.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2')
-rw-r--r-- | trace2/tr2_dst.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/trace2/tr2_dst.c b/trace2/tr2_dst.c index 7d96f33420..6c425f17f3 100644 --- a/trace2/tr2_dst.c +++ b/trace2/tr2_dst.c @@ -166,13 +166,8 @@ connected: static void tr2_dst_malformed_warning(struct tr2_dst *dst, const char *tgt_value) { - struct strbuf buf = STRBUF_INIT; - - strbuf_addf(&buf, "trace2: unknown value for '%s': '%s'", - tr2_sysenv_display_name(dst->sysenv_var), tgt_value); - warning("%s", buf.buf); - - strbuf_release(&buf); + warning("trace2: unknown value for '%s': '%s'", + tr2_sysenv_display_name(dst->sysenv_var), tgt_value); } int tr2_dst_get_trace_fd(struct tr2_dst *dst) |