All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>, git@vger.kernel.org
Subject: Re: [PATCH] diff: drop unused options parameter from cmp_in_block_with_wsd()
Date: Thu, 05 Aug 2021 15:08:04 -0700	[thread overview]
Message-ID: <xmqqa6lvk0jf.fsf@gitster.g> (raw)
In-Reply-To: <YQxOevw7Q+NYX2YF@coredump.intra.peff.net> (Jeff King's message of "Thu, 5 Aug 2021 16:47:54 -0400")

Jeff King <peff@peff.net> writes:

> 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.
>
> 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).

Nice.

>
>  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;

  reply	other threads:[~2021-08-05 22:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 20:47 [PATCH] diff: drop unused options parameter from cmp_in_block_with_wsd() Jeff King
2021-08-05 22:08 ` Junio C Hamano [this message]
2021-08-09 15:17 ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa6lvk0jf.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.