Re: [PATCH v7 5/7] diff-lib: refactor out diff_change logic
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Feb 9, 2023, 20:53 UTC
- Message-ID
- <4a09db46-5c45-c953-d3ff-383499ab0e21@dunelm.org.uk>
- In-Reply-To
- <CAFySSZC31aT4zu=-y1vBBd_Z=KWWYn3-7yziLfVbeK9Foc9c3w@mail.gmail.com>
Hi Calvin
On 08/02/2023 23:12, Calvin Wan wrote:
Show 9 quoted lines
>> I worry that having three integer parameters next to each other makes it >> very easy to mix them up with out getting any errors from the compiler >> because the types are all compatible. Could the last two be combined >> into a flags argument? A similar issues occurs in >> match_stat_with_submodule() in patch 7 > > I'm not sure how much more I want to engineer a static helper function > that is only being called in one other place. I also don't understand what > you mean by combining the last two into paramters a flags argument.
Are `dirty_submodule` and `changed` booleans? If so then you can have a single bit flags argument made up of
#define SUBMODULE_DIRTY 1 #define SUBMODULE_CHANGED 2
Best Wishes
Phillip