From 6ecbab80ed0f68f16476d729c734a388b31e73e2 Mon Sep 17 00:00:00 2001 From: Otis Gospodnetic Date: Thu, 11 Sep 2003 10:02:26 +0000 Subject: [PATCH] - Small distance matrix initialization change. Submitted by: Christoph Goller Reviewed by: Otis git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150018 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/lucene/search/FuzzyTermEnum.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/lucene/search/FuzzyTermEnum.java b/src/java/org/apache/lucene/search/FuzzyTermEnum.java index c69cf50d9a9..cfb4e76f150 100644 --- a/src/java/org/apache/lucene/search/FuzzyTermEnum.java +++ b/src/java/org/apache/lucene/search/FuzzyTermEnum.java @@ -124,7 +124,7 @@ public final class FuzzyTermEnum extends FilteredTermEnum { * This static array saves us from the time required to create a new array * everytime editDistance is called. */ - private int e[][] = new int[0][0]; + private int e[][] = new int[1][1]; /** Levenshtein distance also known as edit distance is a measure of similiarity @@ -137,7 +137,7 @@ public final class FuzzyTermEnum extends FilteredTermEnum { */ private final int editDistance(String s, String t, int n, int m) { if (e.length <= n || e[0].length <= m) { - e = new int[Math.max(e.length, n+1)][Math.max(e.length, m+1)]; + e = new int[Math.max(e.length, n+1)][Math.max(e[0].length, m+1)]; } int d[][] = e; // matrix int i; // iterates through s