Skip to content

Commit

Permalink
[PATCH] Fix math thinko in similarity estimator.
Browse files Browse the repository at this point in the history
The math to reject delta that is too big was confused.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Junio C Hamano authored and Linus Torvalds committed May 29, 2005
1 parent 0746b62 commit a00d7d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diffcore-rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit a00d7d1

Please sign in to comment.