Re: [RFC PATCH 4/5] pack-objects: avoid reading uninitalized data
- From
Jeff King <peff@peff.net>
- Date
- Oct 23, 2008, 15:33 UTC
- Message-ID
- <20081023153329.GC10804@coredump.intra.peff.net>
- In-Reply-To
- <alpine.LFD.2.00.0810222107540.26244@xanadu.home>
On Wed, Oct 22, 2008 at 09:11:16PM -0400, Nicolas Pitre wrote:
Show 18 quoted lines
> > for (;;) {
> > - struct object_entry *entry = *list++;
> > + struct object_entry *entry;
> > struct unpacked *n = array + idx;
> > int j, max_depth, best_base = -1;
> >
> > @@ -1384,6 +1384,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
> > progress_unlock();
> > break;
> > }
>
> ---> Please preserve the empty line here so the previous code
> chunk still appears logically separate.
>
> > + entry = *list++;
> > (*list_size)--;
> > if (!entry->preferred_base) {
> > (*processed)++;Er, there was no empty line there (or else there would have been a '-' line in the diff). I am happy to add it, like:
if (!*list_size) {
progress_unlock();
break;
} entry = *list++;
(*list_size)--;
if (!entry->preferred_base)
...if you like, but the current version seems to format it as one stanza inside of the progress_lock/progress_unlock. Look at the version in 'master' to see what I mean.
-Peff