Re: [PATCH v3 2/9] pack-objects: limit scope in 'add_object_entry_from_pack()'
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 16, 2025, 22:07 UTC
- Message-ID
- <aAAqLWx7dJIgFcr9@nand.local>
- In-Reply-To
- <CABPp-BG-=6uRtHXrzSOMw=J2Shg_vfXhLzwWDREy7OAQg_Ak6w@mail.gmail.com>
On Tue, Apr 15, 2025 at 10:31:26PM -0700, Elijah Newren wrote:
Show 23 quoted lines
> On Tue, Apr 15, 2025 at 3:46 PM Taylor Blau <me@ttaylorr.com> wrote:
> >
> > In add_object_entry_from_pack() we declare 'revs' (given to us through
> > the miscellaneous context argument) earlier in the "if (p)" conditional
> > than is necessary. Move it down as far as it can go to reduce its
> > scope.
> >
> > Signed-off-by: Taylor Blau <me@ttaylorr.com>
> > ---
> > builtin/pack-objects.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> > index 20dd870bbf..4ab695a3aa 100644
> > --- a/builtin/pack-objects.c
> > +++ b/builtin/pack-objects.c
> > @@ -3490,14 +3490,14 @@ static int add_object_entry_from_pack(const struct object_id *oid,
> > return 0;
> >
> > if (p) {
> > - struct rev_info *revs = _data;
>
> This change is half of what you mention in your commit message.Yeah, Junio noted the same in his review as well. See my response there for a cleaner version of this patch.
Thanks, Taylor