{"thread":{"id":"44423","subject":"[PATCH] diffcore-delta: remove unused parameter to diffcore_count_changes()","startedAt":"2016-11-04T10:24:48Z","lastAt":"2016-11-04T16:56:40Z","messageCount":3,"participants":["Tobias Klauser","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"305391","messageId":"20161104102436.23892-1-tklauser@distanz.ch","threadId":"44423","inReplyTo":null,"subject":"[PATCH] diffcore-delta: remove unused parameter to diffcore_count_changes()","fromName":"Tobias Klauser","fromEmail":"tklauser@distanz.ch","sentAt":"2016-11-04T10:24:36Z","receivedAt":"2016-11-04T10:24:48Z","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 c06c79667c95 (\"diffcore-rename: somewhat optimized.\").\nRemove the parameter and adjust all callers.\n\nSigned-off-by: Tobias Klauser <tklauser@distanz.ch>\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":"305398","messageId":"20161104163714.zwzfbmrklzwuaw6u@sigill.intra.peff.net","threadId":"44423","inReplyTo":"20161104102436.23892-1-tklauser@distanz.ch","subject":"Re: [PATCH] diffcore-delta: remove unused parameter to diffcore_count_changes()","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-11-04T16:37:14Z","receivedAt":"2016-11-04T16:37:20Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 04, 2016 at 11:24:36AM +0100, Tobias Klauser wrote:\n\n> The delta_limit parameter to diffcore_count_changes() has been unused\n> since commit c06c79667c95 (\"diffcore-rename: somewhat optimized.\").\n> Remove the parameter and adjust all callers.\n\nSounds like a good idea to get rid of an unused parameter, but I think\nthis went away in ba23bbc8e (diffcore-delta: make change counter to byte\noriented again., 2006-03-04).\n\nThe patch itself looks good.\n\n-Peff\n"},{"id":"305400","messageId":"20161104164658.GB819@distanz.ch","threadId":"44423","inReplyTo":"20161104163714.zwzfbmrklzwuaw6u@sigill.intra.peff.net","subject":"Re: [PATCH] diffcore-delta: remove unused parameter to diffcore_count_changes()","fromName":"Tobias Klauser","fromEmail":"tklauser@distanz.ch","sentAt":"2016-11-04T16:46:58Z","receivedAt":"2016-11-04T16:56:40Z","isPatch":true,"sender":{"key":"tklauser@distanz.ch","avatar":"https://avatars.githubusercontent.com/u/539708?v=4"},"body":"On 2016-11-04 at 17:37:14 +0100, Jeff King <peff@peff.net> wrote:\n> On Fri, Nov 04, 2016 at 11:24:36AM +0100, Tobias Klauser wrote:\n> \n> > The delta_limit parameter to diffcore_count_changes() has been unused\n> > since commit c06c79667c95 (\"diffcore-rename: somewhat optimized.\").\n> > Remove the parameter and adjust all callers.\n> \n> Sounds like a good idea to get rid of an unused parameter, but I think\n> this went away in ba23bbc8e (diffcore-delta: make change counter to byte\n> oriented again., 2006-03-04).\n\nUgh, I must have fat-fingered the commit id. Will update the description\naccordingly for v2.\n\nThanks!\nTobias\n"}]}