Re: [RFC PATCH v2 4/5] range-diff.c: rename "n" to "column_count" in get_correspondences()
- From
Jeff King <peff@peff.net>
- Date
- Dec 14, 2021, 13:42 UTC
- Message-ID
- <YbifXSlwXfMX+Wgl@coredump.intra.peff.net>
- In-Reply-To
- <RFC-patch-v2-4.5-f8bbe1954fc-20211210T122901Z-avarab@gmail.com>
On Fri, Dec 10, 2021 at 01:30:41PM +0100, Ævar Arnfjörð Bjarmason wrote:
> In preparation for using the COST macro in linear-assignment.c rename > the "n" variable, it assumes that the "n" in "a + n * b" is named > "column_count".
OK, makes sense.
One funny thing:
Show 10 quoted lines
> diff --git a/range-diff.c b/range-diff.c
> index b2fcc6f66e0..b2e7db2c954 100644
> --- a/range-diff.c
> +++ b/range-diff.c
> @@ -308,13 +308,13 @@ static int diffsize(const char *a, const char *b)
> static void get_correspondences(struct string_list *a, struct string_list *b,
> int creation_factor)
> {
> - int n = a->nr + b->nr;
> + int column_count = st_add(a->nr, b->nr);Assigning the result of st_add() to an int nullifies the point of using it in the first place. :)
I suspect this was a mistake from rebasing, and you meant only to change the name here, and leave the st_add() for the next commit when the type changes.
> [...]
The rest looks good.
-Peff