From: "Shawn O. Pearce" <spearce@spearce.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] clean up and optimize nth_packed_object_sha1() usage
Date: Thu, 5 Apr 2007 02:27:53 -0400 [thread overview]
Message-ID: <20070405062753.GC5436@spearce.org> (raw)
In-Reply-To: <alpine.LFD.0.98.0704041639070.28181@xanadu.home>
Nicolas Pitre <nico@cam.org> 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.
prev parent reply other threads:[~2007-04-05 6:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-04 20:49 [PATCH] clean up and optimize nth_packed_object_sha1() usage Nicolas Pitre
2007-04-05 6:27 ` Shawn O. Pearce [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070405062753.GC5436@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=nico@cam.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).