git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: git@vger.kernel.org
Cc: Zheng Liu <wenqing.lz@taobao.com>
Subject: [PATCH] Remove useless code about diffcore_count_changes()
Date: Fri, 18 Nov 2011 09:43:36 +0800	[thread overview]
Message-ID: <1321580616-19281-1-git-send-email-wenqing.lz@taobao.com> (raw)

We don't need to check return value because it always returns zero in
diffcore_count_changes().

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 diffcore-break.c  |    7 ++-----
 diffcore-rename.c |    7 ++-----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/diffcore-break.c b/diffcore-break.c
index 44f8678..402bba1 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -68,11 +68,8 @@ static int should_break(struct diff_filespec *src,
 	if (max_size < MINIMUM_BREAK_SIZE)
 		return 0; /* we do not break too small filepair */
 
-	if (diffcore_count_changes(src, dst,
-				   &src->cnt_data, &dst->cnt_data,
-				   0,
-				   &src_copied, &literal_added))
-		return 0;
+	diffcore_count_changes(src, dst, &src->cnt_data, &dst->cnt_data, 0,
+			       &src_copied, &literal_added);
 
 	/* sanity */
 	if (src->size < src_copied)
diff --git a/diffcore-rename.c b/diffcore-rename.c
index f639601..969482f 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -182,11 +182,8 @@ static int estimate_similarity(struct diff_filespec *src,
 
 	delta_limit = (unsigned long)
 		(base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);
-	if (diffcore_count_changes(src, dst,
-				   &src->cnt_data, &dst->cnt_data,
-				   delta_limit,
-				   &src_copied, &literal_added))
-		return 0;
+	diffcore_count_changes(src, dst, &src->cnt_data, &dst->cnt_data,
+			       delta_limit, &src_copied, &literal_added);
 
 	/* How similar are they?
 	 * what percentage of material in dst are from source?
-- 
1.7.5.4

                 reply	other threads:[~2011-11-18  1:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1321580616-19281-1-git-send-email-wenqing.lz@taobao.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=wenqing.lz@taobao.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).