From: Shawn O. Pearce Date: Thu, 05 Apr 2007 06:27:53 GMT Subject: Re: [PATCH] clean up and optimize nth_packed_object_sha1() usage Message-ID: <20070405062753.GC5436@spearce.org> In-Reply-To: Nicolas Pitre 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. > @@ -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.