From: Junio C Hamano Date: Fri, 27 May 2005 22:49:54 +0000 (-0700) Subject: [PATCH] Fix math thinko in similarity estimator. X-Git-Tag: v0.99~436 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a00d7d106aa333c4b4d0095f58e05c0c4621bbc2;p=git.git [PATCH] Fix math thinko in similarity estimator. The math to reject delta that is too big was confused. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- diff --git a/diffcore-rename.c b/diffcore-rename.c index 07782f4b7..81e4d9df3 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -163,7 +163,7 @@ static int estimate_similarity(struct diff_filespec *src, /* A delta that has a lot of literal additions would have * big delta_size no matter what else it does. */ - if (minimum_score < MAX_SCORE * delta_size / base_size) + if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE) return 0; /* Estimate the edit size by interpreting delta. */