Re: [PATCH] clean up and optimize nth_packed_object_sha1() usage
From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:43:03
Nicolas Pitre [off-list ref] wrote:
Let's avoid the open coded pack index reference in pack-object and use nth_packed_object_sha1() instead. This will help encapsulating index format differences in one place. And while at it there is no reason to copy SHA1's over and over while a direct pointer to it in the index will do just fine.
Ack++. ;-) This is a good change. That API has been bothering me for a while.
quoted hunk ↗ jump to hunk
@@ -96,14 +96,14 @@ static int find_short_packed_object(int len, const unsigned char *match, unsigne last = mid; } if (first < num) { - unsigned char now[20], next[20]; - nth_packed_object_sha1(p, first, now); + const unsigned char *now, *next; + now = nth_packed_object_sha1(p, first); if (match_sha(len, match, now)) {
Uh, there is some sort of werid whitespace indent damage on that second added line. It doesn't line up with the first added line, or with either of the context lines. -- Shawn.