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

[PATCH] Remove useless code about diffcore_count_changes()

From
ZLZheng Liu <gnehzuil.liu@gmail.com>
Date
Nov 18, 2011, 01:43 UTC
Message-ID
<1321580616-19281-1-git-send-email-wenqing.lz@taobao.com>

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
Message 1 of 1 in “Remove useless code about diffcore_count_changes()”
  1. Remove useless code about diffcore_count_changes()Zheng Liu, Nov 18, 2011

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.