Re: [PATCH 5/9] xdiff: split xrecord_t.ha into line_hash and minimal_perfect_hash
- From
Ezekiel Newren <ezekielnewren@gmail.com>
- Date
- Oct 20, 2025, 23:29 UTC
- Message-ID
- <CAH=ZcbAjX=V_VvJsRzvQEA+CMM7dWQx6E5=d4FL5CD3s+ozjBg@mail.gmail.com>
- In-Reply-To
- <a3e706ecdae51434fd5ee112c13f8cf374faf6ed.1760563101.git.gitgitgadget@gmail.com>
On Wed, Oct 15, 2025 at 3:18 PM Ezekiel Newren via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 18 quoted lines
> > From: Ezekiel Newren <ezekielnewren@gmail.com> > > The ha field is serving two different purposes, which makes the code > harder to read. At first glance it looks like many places assume > there could never be hash collisions between lines of the two input > files. In reality, line_hash is used together with xdl_recmatch() to > ensure correct comparisons of lines, even when collisions occur. > > To make this clearer, the old ha field has been split: > * line_hash: The straightforward hash of a line, requiring no > additional context. > * minimal_perfect_hash: Not a new concept, but now a separate > field. It comes from the classifier's general-purpose hash table, > which assigns each line a unique and minimal hash across the two > files. > > Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
I'm a bit surprised that nobody has commented on this patch. I thought that someone would have criticized the length of the name "minimal_perfect_hash" or asked me why I was splitting one field into two.
I don't see any reason why this patch series shouldn't move forward.