Re: [PATCH 06/13] object-file: move loose object cache into loose source
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 24, 2025, 21:44 UTC
- Message-ID
- <xmqqzf9gnfe6.fsf@gitster.g>
- In-Reply-To
- <20251024-b4-pks-odb-loose-backend-v1-6-1a4202273c38@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 9 quoted lines
> @@ -2006,5 +2006,8 @@ struct odb_loose_source *odb_loose_source_new(struct odb_source *source)
>
> void odb_loose_source_free(struct odb_loose_source *source)
> {
> + if (!source)
> + return;
> + odb_clear_loose_cache(source->source);
> free(source);
> }This had me confused, especially the source->source part. Perhaps call the parameter "loose" so loose->source is the way for somebody who has a odb_loose_source to learn what odb_source it belongs to, or something. Of course the round-about way to clera the cache that now belongs to odb_loose_source by taking odb_source looked awkward in this step, but that awkwardness goes away immediately in the next step. And the parameter of type "odb_loose_source *" called "source" here, instead of "loose", still hurts after the next step [07/13] is applied.