mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
[PATCH] Fix math thinko in similarity estimator.
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>
This commit is contained in:
parent
0746b62001
commit
a00d7d106a
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue