* [PATCH] Remove useless code about diffcore_count_changes()
@ 2011-11-18 1:43 Zheng Liu
0 siblings, 0 replies; only message in thread
From: Zheng Liu @ 2011-11-18 1:43 UTC (permalink / raw)
To: git; +Cc: Zheng Liu
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-11-18 1:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-18 1:43 [PATCH] Remove useless code about diffcore_count_changes() Zheng Liu
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).