Skip to content
This repository
Browse code

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...
commit d6215e6c039f7d8bdd3dbafd738c5652e7dffe7e 2 parents a20bb12 + 648e52c
David Pollak authored
5  core/util/src/main/scala/net/liftweb/util/LD.scala
@@ -91,7 +91,10 @@ object LD {
91 91
                                       new ListBuffer))
92 92
       }
93 93
 
94  
-    matrix(y1, 0, (1 to x.length).toList).last
  94
+    matrix(y1, 0, (1 to x.length).toList) match {
  95
+      case Nil => 100000
  96
+      case xs => xs.last
  97
+    }
95 98
   }
96 99
 }
97 100
 

0 notes on commit d6215e6

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