git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Phillip Wood <phillip.wood@dunelm.org.uk>, git@vger.kernel.org
Subject: [PATCH 3/3] xdiff: drop unused flags parameter from recs_match
Date: Fri, 3 Dec 2021 00:12:01 -0500	[thread overview]
Message-ID: <YamnIeXz+EscCTZC@coredump.intra.peff.net> (raw)
In-Reply-To: <Yammtm+pIkMu43zZ@coredump.intra.peff.net>

Since 6b13bc3232 (xdiff: simplify comparison, 2021-11-17), we do not
call xdl_recmatch() from xdiffi.c's recs_match(), so we no longer need
the "flags" parameter. That in turn lets us drop the flags parameters
from the group-slide functions which call it.

There's no functional change here; it's just making these functions a
little simpler.

Signed-off-by: Jeff King <peff@peff.net>
---
 xdiff/xdiffi.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
index 6a3b9280be..69689fab24 100644
--- a/xdiff/xdiffi.c
+++ b/xdiff/xdiffi.c
@@ -390,7 +390,7 @@ static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1,
 }
 
 
-static int recs_match(xrecord_t *rec1, xrecord_t *rec2, long flags)
+static int recs_match(xrecord_t *rec1, xrecord_t *rec2)
 {
 	return (rec1->ha == rec2->ha);
 }
@@ -756,10 +756,10 @@ static inline int group_previous(xdfile_t *xdf, struct xdlgroup *g)
  * following group, expand this group to include it. Return 0 on success or -1
  * if g cannot be slid down.
  */
-static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g, long flags)
+static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g)
 {
 	if (g->end < xdf->nrec &&
-	    recs_match(xdf->recs[g->start], xdf->recs[g->end], flags)) {
+	    recs_match(xdf->recs[g->start], xdf->recs[g->end])) {
 		xdf->rchg[g->start++] = 0;
 		xdf->rchg[g->end++] = 1;
 
@@ -777,10 +777,10 @@ static int group_slide_down(xdfile_t *xdf, struct xdlgroup *g, long flags)
  * into a previous group, expand this group to include it. Return 0 on success
  * or -1 if g cannot be slid up.
  */
-static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g, long flags)
+static int group_slide_up(xdfile_t *xdf, struct xdlgroup *g)
 {
 	if (g->start > 0 &&
-	    recs_match(xdf->recs[g->start - 1], xdf->recs[g->end - 1], flags)) {
+	    recs_match(xdf->recs[g->start - 1], xdf->recs[g->end - 1])) {
 		xdf->rchg[--g->start] = 1;
 		xdf->rchg[--g->end] = 0;
 
@@ -830,7 +830,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 			end_matching_other = -1;
 
 			/* Shift the group backward as much as possible: */
-			while (!group_slide_up(xdf, &g, flags))
+			while (!group_slide_up(xdf, &g))
 				if (group_previous(xdfo, &go))
 					BUG("group sync broken sliding up");
 
@@ -845,7 +845,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 
 			/* Now shift the group forward as far as possible: */
 			while (1) {
-				if (group_slide_down(xdf, &g, flags))
+				if (group_slide_down(xdf, &g))
 					break;
 				if (group_next(xdfo, &go))
 					BUG("group sync broken sliding down");
@@ -872,7 +872,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 			 * other file that it can align with.
 			 */
 			while (go.end == go.start) {
-				if (group_slide_up(xdf, &g, flags))
+				if (group_slide_up(xdf, &g))
 					BUG("match disappeared");
 				if (group_previous(xdfo, &go))
 					BUG("group sync broken sliding to match");
@@ -915,7 +915,7 @@ int xdl_change_compact(xdfile_t *xdf, xdfile_t *xdfo, long flags) {
 			}
 
 			while (g.end > best_shift) {
-				if (group_slide_up(xdf, &g, flags))
+				if (group_slide_up(xdf, &g))
 					BUG("best shift unreached");
 				if (group_previous(xdfo, &go))
 					BUG("group sync broken sliding to blank line");
-- 
2.34.1.436.g8c445b282e

  parent reply	other threads:[~2021-12-03  5:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  2:16 What's cooking in git.git (Nov 2021, #07; Mon, 29) Junio C Hamano
2021-11-30  7:33 ` jk/loosen-urlmatch, was " Jeff King
2021-11-30 13:17   ` brian m. carlson
2021-11-30 20:54 ` ab/run-command + em/missing-pager (was: What's cooking in git.git (Nov 2021, #07; Mon, 29)) Ævar Arnfjörð Bjarmason
2021-11-30 21:17   ` Jeff King
2021-11-30 22:09   ` Eric Sunshine
2021-11-30 21:08 ` ab/ci-updates " Ævar Arnfjörð Bjarmason
2021-11-30 21:12 ` ab/config-based-hooks-2 " Ævar Arnfjörð Bjarmason
2021-11-30 21:17 ` fs/test-prereq " Ævar Arnfjörð Bjarmason
2021-12-01  8:53   ` Fabian Stelzer
2021-11-30 21:18 ` jc/c99-var-decl-in-for-loop " Ævar Arnfjörð Bjarmason
2021-11-30 23:07 ` ns/tmp-objdir and ns/remerge-diff Elijah Newren
2021-12-03 19:21   ` Junio C Hamano
2021-12-04  2:58     ` Neeraj Singh
2021-12-04  5:51       ` Elijah Newren
2021-11-30 23:35 ` What's cooking in git.git (Nov 2021, #07; Mon, 29) Elijah Newren
2021-12-01 19:29   ` Victoria Dye
2021-11-30 23:45 ` Elijah Newren
2021-12-01  1:42   ` Aleen 徐沛文
2021-12-01 20:56     ` Elijah Newren
2021-12-03 18:21       ` Ævar Arnfjörð Bjarmason
2021-12-03 19:28         ` Elijah Newren
2021-12-03 19:56           ` Ævar Arnfjörð Bjarmason
2021-12-06  1:25             ` Aleen 徐沛文
2021-12-06  6:28               ` Junio C Hamano
2021-12-06  6:44                 ` Aleen 徐沛文
2021-12-06  6:46                   ` Aleen 徐沛文
2021-12-06 17:23                   ` Junio C Hamano
2021-12-07  1:06                     ` Aleen 徐沛文
2021-12-07  1:29                       ` Junio C Hamano
2021-12-07  1:58                         ` Aleen 徐沛文
2021-12-06 17:37                 ` Elijah Newren
2021-12-06 17:50                   ` Junio C Hamano
2021-11-30 23:52 ` en/zdiff3 (was: Re: What's cooking in git.git (Nov 2021, #07; Mon, 29)) Elijah Newren
2021-12-01 22:15   ` en/zdiff3 Junio C Hamano
2021-12-01  8:59 ` What's cooking in git.git (Nov 2021, #07; Mon, 29) Fabian Stelzer
2021-12-03  1:12 ` Junio C Hamano
2021-12-03  5:10 ` [PATCH 0/3] unused-parameter cleanups on top of pw/xdiff-classify-record-in-histogram Jeff King
2021-12-03  5:11   ` [PATCH 1/3] xdiff: drop CMP_ENV macro from xhistogram Jeff King
2021-12-03  5:11   ` [PATCH 2/3] xdiff: drop xpparam_t parameter from histogram cmp_recs() Jeff King
2021-12-03  5:12   ` Jeff King [this message]
2021-12-06 18:59   ` [PATCH 0/3] unused-parameter cleanups on top of pw/xdiff-classify-record-in-histogram 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=YamnIeXz+EscCTZC@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).