Thread (1 message) 1 message, 1 author, 2016-06-15
DORMANTno replies

[PATCH 01/12] Fix math thinko in similarity estimator.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:58
Subsystem: the rest · Maintainer: Linus Torvalds

The math to reject delta that is too big was confused.

Signed-off-by: Junio C Hamano <redacted>
---

diffcore-rename.c |    2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/diffcore-rename.c b/diffcore-rename.c
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -163,7 +163,7 @@ static int estimate_similarity(struct di
 	/* 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. */
------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help