summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-10-15 16:43:41 -0600
committerRocky Madden <git@rockymadden.com>2012-10-15 16:43:41 -0600
commit929d2fea2affc40291adf6b1585c9ad1ad837a17 (patch)
treeb5bfbc0428efd1e34f971ed7bd920131f607538c /core
parent7c281741232063f7df85bc2f9c07a93fc9adf044 (diff)
downloadstringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.tar.gz
stringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.tar.bz2
stringmetric-929d2fea2affc40291adf6b1585c9ad1ad837a17.zip
Fixed bug where require on variable p was incorrectly allowing values from o.last.
Diffstat (limited to 'core')
-rwxr-xr-xcore/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala b/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala
index b3033de..40de464 100755
--- a/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala
+++ b/core/source/core/scala/org/hashtree/stringmetric/SoundexMetric.scala
@@ -36,7 +36,7 @@ object SoundexMetric extends StringMetric {
@tailrec
def code(i: Array[Char], p: Char, o: Array[Char]): Array[Char] = {
require(i.length > 0)
- require((p >= 97 && p <= 122) || (p >= 49 && p <= 54))
+ require(p >= 97 && p <= 122)
require(o.length > 0)
val c = i.head.toLower
@@ -58,7 +58,6 @@ object SoundexMetric extends StringMetric {
case 'r' if pc != '6' => '6'
case _ => '\0'
}
-
val a =
p match {
// Code twice.