git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: drop unused options parameter from cmp_in_block_with_wsd()

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Aug 9, 2021, 15:17 UTC
Message-ID
<ecb2961f-090e-aa84-4180-65ab43c8920d@gmail.com>
In-Reply-To
<YQxOevw7Q+NYX2YF@coredump.intra.peff.net>
On 05/08/2021 21:47, Jeff King wrote:
Show 7 quoted lines
> When 8e809cbb2f (diff --color-moved-ws=allow-indentation-change:
> simplify and optimize, 2021-07-20) stopped looking at o->emitted_symbols
> and instead took the symbol as a parameter, we no longer need to look at
> the diff_options struct at all.
> 
> Dropping the unused parameter makes it clear that the function is
> independent of the diff options.
Thanks Peff
Best Wishes
Phillip
Show 33 quoted lines
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> Just a small cleanup on top of pw/diff-color-moved-fix, which is now in
> 'next'. I noticed due to my -Wunused-parameters patches (which one day
> I'll finally clean up enough to send to the list).
> 
>   diff.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/diff.c b/diff.c
> index 2956c8f710..164af13b4f 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -863,8 +863,7 @@ static int compute_ws_delta(const struct emitted_diff_symbol *a,
>   	return a_width - b_width;
>   }
>   
> -static int cmp_in_block_with_wsd(const struct diff_options *o,
> -				 const struct moved_entry *cur,
> +static int cmp_in_block_with_wsd(const struct moved_entry *cur,
>   				 const struct emitted_diff_symbol *l,
>   				 struct moved_block *pmb)
>   {
> @@ -1016,7 +1015,7 @@ static void pmb_advance_or_null(struct diff_options *o,
>   		if (o->color_moved_ws_handling &
>   		    COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE)
>   			match = cur &&
> -				!cmp_in_block_with_wsd(o, cur, l, &pmb[i]);
> +				!cmp_in_block_with_wsd(cur, l, &pmb[i]);
>   		else
>   			match = cur && cur->es->id == l->id;
>   
> 
Previous: Junio C Hamano
Message 3 of 3 in “diff: drop unused options parameter from cmp_in_block_with_wsd()”
  1. diff: drop unused options parameter from cmp_in_block_with_wsd()Jeff King, Aug 5, 2021
  2. Junio C HamanoAug 5, 2021
  3. Phillip WoodAug 9, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.