Skip to content
Browse files

Merge pull request #1225 from lift/dpp_issue_1225

Levenshtein distance in net.liftweb.util.LD - exception if first parameter is empty.
  • Loading branch information...
2 parents a20bb12 + 648e52c commit d6215e6c039f7d8bdd3dbafd738c5652e7dffe7e @dpp dpp committed Mar 1, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/util/src/main/scala/net/liftweb/util/LD.scala
View
5 core/util/src/main/scala/net/liftweb/util/LD.scala
@@ -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
+ }
}
}

0 comments on commit d6215e6

Please sign in to comment.
Something went wrong with that request. Please try again.