Re: [PATCH v2 01/15] pack-bitmap: factor out type iterator initialization
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Feb 15, 2020, 00:10 UTC
- Message-ID
- <20200215001036.GD11400@syl.local>
- In-Reply-To
- <20200214182208.GA150965@coredump.intra.peff.net>
Hi Peff,
On Fri, Feb 14, 2020 at 01:22:08PM -0500, Jeff King wrote:
Show 14 quoted lines
> When count_object_type() wants to iterate over the bitmap of all objects > of a certain type, we have to pair up OBJ_COMMIT with bitmap->commits, > and so forth. Since we're about to add more code to iterate over these > bitmaps, let's pull the initialization into its own function. > > We can also use this to simplify traverse_bitmap_commit_list(). It > accomplishes the same thing by manually passing the object type and the > bitmap to show_objects_for_type(), but using our helper we just need the > object type. > > Note there's one small code change here: previously we'd simply return > zero when counting an unknown object type, and now we'll BUG(). This > shouldn't matter in practice, as all of the callers pass in only usual > commit/tree/blob/tag types.
This all makes sense, as does the refactoring below.
On a relaid note: since you sent 'v2' before I had popped enough items off of my TODO list to look at your 'v1', I'll start my review in this thread instead of in v1.
> Signed-off-by: Jeff King <peff@peff.net>
Thanks, Taylor