Re: [PATCH v2 2/6] pack-bitmap-write.c: write lookup table extension
Derrick Stolee <derrickstolee@github.com> wrote:
Show 21 quoted lines
> Which means that if "k = table[i] - xor_offset" that the xor base is the kth
> bitmap. table_inv[k] gets us the position in this table of that bitmap's
> commit.
>
> (It's also strange to me that the offset is being _subtracted_, but I guess
> the bitmap format requires the xor base to appear first so the offset does
> not need to be a negative number ever.)
>
> This last line is a bit complex.
>
> uint32_t xor_offset = selected->xor_offset;
> uint32_t xor_row = 0xffffffff;
>
> if (xor_offset) {
> uint32_t xor_order = table[i] - xor_offset;
> xor_row = table_inf[xor_order];
> }
>
> ...then we can "hashwrite_be32(f, xor_row);" when necessary. I'm not sure
> that we need the "uint32_t xor_order" inside the "if (xor_offset)" block,
> but splitting it helps add clarity to the multi-step computation.Got it. Will add comments too.
Thanks :)