Re: [PATCH v5 13/13] xdiff: change type of xdfile_t.changed from char to bool
- From
Ezekiel Newren <ezekielnewren@gmail.com>
- Date
- Sep 24, 2025, 15:14 UTC
- Message-ID
- <CAH=ZcbBzG+Ekzp-mE+MBDbU2PaP3qikyJJcgnh_G2+mOf67CWQ@mail.gmail.com>
- In-Reply-To
- <a17e00fa-bf4b-4b53-817b-297236178101@gmail.com>
On Wed, Sep 24, 2025 at 4:21 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 17 quoted lines
> > On 23/09/2025 22:24, Ezekiel Newren via GitGitGadget wrote: > > From: Ezekiel Newren <ezekielnewren@gmail.com> > > > > The only values possible for 'changed' is 1 and 0, which exactly maps > > to a bool type. It might not look like this is the case because > > matches1 and matches2 (which use to be dis1, and dis2) were also char > > and were assigned numerical values within a few lines of 'changed' > > (what used to be rchg). > > > > Using NONE, SOME, TOO_MANY for matches1[i]/matches2[j], and true/false > > for changed[k] makes it clear to future readers that these are > > logically separate concepts. > > Nicely explained - I think this change is a very good idea and > separating it out like this makes it much clearer what's going on > compared to V4.
Thank you! It was obvious to me because I've been refactoring xdiff for many months now, but I wasn't doing a good job of expressing why these 2 concepts are closely related, but distinct.