[PATCH] Remove useless code about diffcore_count_changes()
From: Zheng Liu <hidden>
Date: 2016-06-15 22:52:30
Subsystem:
the rest · Maintainer:
Linus Torvalds
We don't need to check return value because it always returns zero in diffcore_count_changes(). Signed-off-by: Zheng Liu <redacted> --- 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