use strbuf_addstr() instead of strbuf_addf() with "%s"

Call strbuf_addstr() for adding a simple string to a strbuf instead of
using the heavier strbuf_addf().  This is shorter and documents the
intent more clearly.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2016-08-05 22:37:11 +02:00
committed by Junio C Hamano
parent 02962d3684
commit bc57b9c0cc
3 changed files with 3 additions and 3 deletions

2
http.c
View File

@ -1105,7 +1105,7 @@ void append_remote_object_url(struct strbuf *buf, const char *url,
strbuf_addf(buf, "objects/%.*s/", 2, hex);
if (!only_two_digit_prefix)
strbuf_addf(buf, "%s", hex+2);
strbuf_addstr(buf, hex + 2);
}
char *get_remote_object_url(const char *url, const char *hex,