author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 19 Apr 2010 14:23:05 +0000 (07:23 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 20 Apr 2010 00:55:59 +0000 (17:55 -0700) | ||
commit | 162eb5f838630f75f78f26d28b46b02781724b7d | |
tree | 7fbce6b3fc783f93cbc855657c7cc162aab0da8a | tree | snapshot |
parent | 0da8b2e7c80a6dd9743e5233cdc5acd836c9a8d3 | commit | diff |
http.c: Remove unnecessary strdup of sha1_to_hex result
Most of the time the dumb HTTP transport is run without the verbose
flag set, so we only need the result of sha1_to_hex(sha1) once, to
construct the pack URL. Don't bother with an unnecessary malloc,
copy, free chain of this buffer.
If verbose is set, we'll format the SHA-1 twice now. But this
tiny extra CPU time spent is nothing compared to the slowdown that
is usually imposed by the verbose messages being sent to the tty,
and is entirely trivial compared to the latency involved with the
remote HTTP server sending something as big as a pack file.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Most of the time the dumb HTTP transport is run without the verbose
flag set, so we only need the result of sha1_to_hex(sha1) once, to
construct the pack URL. Don't bother with an unnecessary malloc,
copy, free chain of this buffer.
If verbose is set, we'll format the SHA-1 twice now. But this
tiny extra CPU time spent is nothing compared to the slowdown that
is usually imposed by the verbose messages being sent to the tty,
and is entirely trivial compared to the latency involved with the
remote HTTP server sending something as big as a pack file.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c | diff | blob | history |