{"thread":{"id":"28968","subject":"[PATCH] Remove useless code about diffcore_count_changes()","startedAt":"2011-11-18T01:43:36Z","lastAt":"2011-11-18T01:43:36Z","messageCount":1,"participants":["Zheng Liu"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"179662","messageId":"1321580616-19281-1-git-send-email-wenqing.lz@taobao.com","threadId":"28968","inReplyTo":null,"subject":"[PATCH] Remove useless code about diffcore_count_changes()","fromName":"Zheng Liu","fromEmail":"gnehzuil.liu@gmail.com","sentAt":"2011-11-18T01:43:36Z","receivedAt":"2011-11-18T01:43:36Z","isPatch":true,"sender":{"key":"gnehzuil.liu@gmail.com","avatar":null},"body":"We don't need to check return value because it always returns zero in\ndiffcore_count_changes().\n\nSigned-off-by: Zheng Liu <wenqing.lz@taobao.com>\n---\n diffcore-break.c  |    7 ++-----\n diffcore-rename.c |    7 ++-----\n 2 files changed, 4 insertions(+), 10 deletions(-)\n\ndiff --git a/diffcore-break.c b/diffcore-break.c\nindex 44f8678..402bba1 100644\n--- a/diffcore-break.c\n+++ b/diffcore-break.c\n@@ -68,11 +68,8 @@ static int should_break(struct diff_filespec *src,\n \tif (max_size < MINIMUM_BREAK_SIZE)\n \t\treturn 0; /* we do not break too small filepair */\n \n-\tif (diffcore_count_changes(src, dst,\n-\t\t\t\t   &src->cnt_data, &dst->cnt_data,\n-\t\t\t\t   0,\n-\t\t\t\t   &src_copied, &literal_added))\n-\t\treturn 0;\n+\tdiffcore_count_changes(src, dst, &src->cnt_data, &dst->cnt_data, 0,\n+\t\t\t       &src_copied, &literal_added);\n \n \t/* sanity */\n \tif (src->size < src_copied)\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex f639601..969482f 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -182,11 +182,8 @@ static int estimate_similarity(struct diff_filespec *src,\n \n \tdelta_limit = (unsigned long)\n \t\t(base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);\n-\tif (diffcore_count_changes(src, dst,\n-\t\t\t\t   &src->cnt_data, &dst->cnt_data,\n-\t\t\t\t   delta_limit,\n-\t\t\t\t   &src_copied, &literal_added))\n-\t\treturn 0;\n+\tdiffcore_count_changes(src, dst, &src->cnt_data, &dst->cnt_data,\n+\t\t\t       delta_limit, &src_copied, &literal_added);\n \n \t/* How similar are they?\n \t * what percentage of material in dst are from source?\n-- \n1.7.5.4\n"}]}