git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: git@vger.kernel.org, dstolee@microsoft.com, gitster@pobox.com,
	davvid@gmail.com
Cc: Alex Henrie <alexhenrie24@gmail.com>
Subject: [PATCH 2/3] diffcore-break: use a goto instead of a redundant if statement
Date: Tue, 24 Sep 2019 20:01:57 -0600	[thread overview]
Message-ID: <20190925020158.751492-3-alexhenrie24@gmail.com> (raw)
In-Reply-To: <20190925020158.751492-1-alexhenrie24@gmail.com>

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 diffcore-break.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/diffcore-break.c b/diffcore-break.c
index 875aefd3fe..f6ab74141b 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -286,18 +286,17 @@ void diffcore_merge_broken(void)
 					/* Peer survived.  Merge them */
 					merge_broken(p, pp, &outq);
 					q->queue[j] = NULL;
-					break;
+					goto done;
 				}
 			}
-			if (q->nr <= j)
-				/* The peer did not survive, so we keep
-				 * it in the output.
-				 */
-				diff_q(&outq, p);
+			/* The peer did not survive, so we keep
+			 * it in the output.
+			 */
 		}
-		else
-			diff_q(&outq, p);
+		diff_q(&outq, p);
 	}
+
+done:
 	free(q->queue);
 	*q = outq;
 
-- 
2.23.0


  parent reply	other threads:[~2019-09-25  2:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25  2:01 [PATCH 0/3] scan-build fixes Alex Henrie
2019-09-25  2:01 ` [PATCH 1/3] commit-graph: remove a duplicate assignment Alex Henrie
2019-09-26 13:02   ` Derrick Stolee
2019-09-26 18:05     ` Alex Henrie
2019-09-25  2:01 ` Alex Henrie [this message]
2019-09-26 13:12   ` [PATCH 2/3] diffcore-break: use a goto instead of a redundant if statement Derrick Stolee
2019-09-25  2:01 ` [PATCH 3/3] wrapper: use a loop instead of repetitive statements Alex Henrie
2019-09-26 13:13   ` Derrick Stolee
2019-09-26 20:14     ` Johannes Schindelin
2019-09-27  2:50       ` Jeff King
2019-09-29  0:51         ` Alex Henrie
2019-09-27  2:45   ` Jeff King
2019-09-27 11:48     ` Derrick Stolee

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=20190925020158.751492-3-alexhenrie24@gmail.com \
    --to=alexhenrie24@gmail.com \
    --cc=davvid@gmail.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 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 NNTP newsgroup(s).