git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix deletion of last character in levenshtein distance
@ 2008-11-18 18:53 Samuel Tardieu
  2008-11-18 20:23 ` Matthieu Moy
  2008-11-19  0:53 ` Johannes Schindelin
  0 siblings, 2 replies; 12+ messages in thread
From: Samuel Tardieu @ 2008-11-18 18:53 UTC (permalink / raw)
  To: git

Without this change, "git tags" will not suggest "git tag"
(it will only suggest "git status"), and "git statusx" will
not suggest anything.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 levenshtein.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/levenshtein.c b/levenshtein.c
index db52f2c..98fea72 100644
--- a/levenshtein.c
+++ b/levenshtein.c
@@ -25,7 +25,7 @@ int levenshtein(const char *string1, const char *string2,
 					row2[j + 1] > row0[j - 1] + w)
 				row2[j + 1] = row0[j - 1] + w;
 			/* deletion */
-			if (j + 1 < len2 && row2[j + 1] > row1[j + 1] + d)
+			if (row2[j + 1] > row1[j + 1] + d)
 				row2[j + 1] = row1[j + 1] + d;
 			/* insertion */
 			if (row2[j + 1] > row2[j] + a)

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-11-20 18:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-18 18:53 [PATCH] Fix deletion of last character in levenshtein distance Samuel Tardieu
2008-11-18 20:23 ` Matthieu Moy
2008-11-19  0:53 ` Johannes Schindelin
2008-11-19  8:42   ` Samuel Tardieu
2008-11-19  9:57     ` Johannes Schindelin
2008-11-19 13:13       ` Junio C Hamano
2008-11-20 12:00         ` [PATCH] Document levenshtein.c Johannes Schindelin
2008-11-20 12:00           ` Samuel Tardieu
2008-11-20 13:27             ` [PATCH v2] " Johannes Schindelin
2008-11-20 17:21               ` Jon Loeliger
2008-11-20 17:48                 ` Sverre Rabbelier
2008-11-20 18:31                 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).