Levenshtein distance in net.liftweb.util.LD - exception if first parameter is empty. #1225

Merged
merged 2 commits into from Mar 1, 2012
@@ -91,7 +91,10 @@ object LD {
new ListBuffer))
}
- matrix(y1, 0, (1 to x.length).toList).last
+ matrix(y1, 0, (1 to x.length).toList) match {
+ case Nil => 100000
+ case xs => xs.last
+ }
}
}