From 3e74bcbfedaea6966a941056fa777f438ef82ffe Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 25 Nov 2015 15:56:26 +0300 Subject: [PATCH] Review fixes. --- base/string_utils.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/string_utils.hpp b/base/string_utils.hpp index 9c50a9084d..850a7c8f61 100644 --- a/base/string_utils.hpp +++ b/base/string_utils.hpp @@ -336,8 +336,7 @@ uint32_t EditDistance(TIter const & b1, TIter const & e1, TIter const & b2, TIte { auto const & c2 = *it2; - best[i][j] = min(best[i][j], best[i - 1][j] + 1); - best[i][j] = min(best[i][j], best[i][j - 1] + 1); + best[i][j] = min(best[i - 1][j], best[i][j - 1]) + 1; best[i][j] = min(best[i][j], best[i - 1][j - 1] + (c1 == c2 ? 0 : 1)); } }