{"thread":{"id":"44479","subject":"[PATCH v2] diffcore-delta: remove unused parameter to diffcore_count_changes()","startedAt":"2016-11-14T13:41:04Z","lastAt":"2016-11-14T14:02:32Z","messageCount":2,"participants":["Tobias Klauser","Jeff King"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"305884","messageId":"20161114133905.6632-1-tklauser@distanz.ch","threadId":"44479","inReplyTo":null,"subject":"[PATCH v2] diffcore-delta: remove unused parameter to diffcore_count_changes()","fromName":"Tobias Klauser","fromEmail":"tklauser@distanz.ch","sentAt":"2016-11-14T13:39:05Z","receivedAt":"2016-11-14T13:41:04Z","isPatch":true,"sender":{"key":"tklauser@distanz.ch","avatar":"https://avatars.githubusercontent.com/u/539708?v=4"},"body":"The delta_limit parameter to diffcore_count_changes() has been unused\nsince commit ba23bbc8e (\"diffcore-delta: make change counter to byte\noriented again.\", 2006-03-04).\n\nRemove the parameter and adjust all callers.\n\nSigned-off-by: Tobias Klauser <tklauser@distanz.ch>\n---\nv2: In the commit message, reference the correct commit where the parameter\n    usage was removed. Spotted by Jeff King.\n\n diff.c            | 2 +-\n diffcore-break.c  | 1 -\n diffcore-delta.c  | 1 -\n diffcore-rename.c | 4 ----\n diffcore.h        | 1 -\n 5 files changed, 1 insertion(+), 8 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 8981477c436d..ec8728362dae 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2023,7 +2023,7 @@ static void show_dirstat(struct diff_options *options)\n \t\tif (DIFF_FILE_VALID(p->one) && DIFF_FILE_VALID(p->two)) {\n \t\t\tdiff_populate_filespec(p->one, 0);\n \t\t\tdiff_populate_filespec(p->two, 0);\n-\t\t\tdiffcore_count_changes(p->one, p->two, NULL, NULL, 0,\n+\t\t\tdiffcore_count_changes(p->one, p->two, NULL, NULL,\n \t\t\t\t\t       &copied, &added);\n \t\t\tdiff_free_filespec_data(p->one);\n \t\t\tdiff_free_filespec_data(p->two);\ndiff --git a/diffcore-break.c b/diffcore-break.c\nindex 881a74f29e4f..c64359f489c8 100644\n--- a/diffcore-break.c\n+++ b/diffcore-break.c\n@@ -73,7 +73,6 @@ static int should_break(struct diff_filespec *src,\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 \ndiff --git a/diffcore-delta.c b/diffcore-delta.c\nindex 2ebedb32d18a..ebe70fb06851 100644\n--- a/diffcore-delta.c\n+++ b/diffcore-delta.c\n@@ -166,7 +166,6 @@ int diffcore_count_changes(struct diff_filespec *src,\n \t\t\t   struct diff_filespec *dst,\n \t\t\t   void **src_count_p,\n \t\t\t   void **dst_count_p,\n-\t\t\t   unsigned long delta_limit,\n \t\t\t   unsigned long *src_copied,\n \t\t\t   unsigned long *literal_added)\n {\ndiff --git a/diffcore-rename.c b/diffcore-rename.c\nindex 54a2396653df..f7444c86bde3 100644\n--- a/diffcore-rename.c\n+++ b/diffcore-rename.c\n@@ -145,7 +145,6 @@ static int estimate_similarity(struct diff_filespec *src,\n \t * call into this function in that case.\n \t */\n \tunsigned long max_size, delta_size, base_size, src_copied, literal_added;\n-\tunsigned long delta_limit;\n \tint score;\n \n \t/* We deal only with regular files.  Symlink renames are handled\n@@ -191,11 +190,8 @@ static int estimate_similarity(struct diff_filespec *src,\n \tif (!dst->cnt_data && diff_populate_filespec(dst, 0))\n \t\treturn 0;\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 \ndiff --git a/diffcore.h b/diffcore.h\nindex c11b8465fc8e..623024135478 100644\n--- a/diffcore.h\n+++ b/diffcore.h\n@@ -142,7 +142,6 @@ extern int diffcore_count_changes(struct diff_filespec *src,\n \t\t\t\t  struct diff_filespec *dst,\n \t\t\t\t  void **src_count_p,\n \t\t\t\t  void **dst_count_p,\n-\t\t\t\t  unsigned long delta_limit,\n \t\t\t\t  unsigned long *src_copied,\n \t\t\t\t  unsigned long *literal_added);\n \n-- \n2.9.0\n\n\n"},{"id":"305885","messageId":"20161114140209.6bldrtruqs5ltndk@sigill.intra.peff.net","threadId":"44479","inReplyTo":"20161114133905.6632-1-tklauser@distanz.ch","subject":"Re: [PATCH v2] diffcore-delta: remove unused parameter to diffcore_count_changes()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-11-14T14:02:09Z","receivedAt":"2016-11-14T14:02:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 14, 2016 at 02:39:05PM +0100, Tobias Klauser wrote:\n\n> The delta_limit parameter to diffcore_count_changes() has been unused\n> since commit ba23bbc8e (\"diffcore-delta: make change counter to byte\n> oriented again.\", 2006-03-04).\n> \n> Remove the parameter and adjust all callers.\n> \n> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>\n> ---\n> v2: In the commit message, reference the correct commit where the parameter\n>     usage was removed. Spotted by Jeff King.\n\nLooks good. Thanks for following up.\n\n-Peff\n"}]}