From 24a77ea03f192a0cc5e65ae93a6b203b256a8490 Mon Sep 17 00:00:00 2001 From: Al Date: Fri, 29 Dec 2017 00:04:24 -0500 Subject: [PATCH] [fix] another valgrind error in counting transposes in our counting affine gap implementation (mixed indices) --- src/string_similarity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_similarity.c b/src/string_similarity.c index bcef0380..61882325 100644 --- a/src/string_similarity.c +++ b/src/string_similarity.c @@ -184,7 +184,7 @@ affine_gap_edits_t affine_gap_distance_unicode_costs(uint32_array *u1_array, uin bool is_transpose = false; size_t w = c1 != c2 && !both_separators ? mismatch_cost : match_cost; - if (c1 != c2 && utf8_is_letter(utf8proc_category(c2)) && utf8_is_letter(utf8proc_category(c1)) && i < n && c2 == u1[i] && j < m && c1 == u2[j]) { + if (c1 != c2 && utf8_is_letter(utf8proc_category(c2)) && utf8_is_letter(utf8proc_category(c1)) && j < m && c2 == u1[j] && i < n && c1 == u2[i]) { w = transpose_cost; is_transpose = true; }