diff options
author | Rocky Madden <git@rockymadden.com> | 2012-10-16 17:10:48 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2012-10-16 17:10:48 -0600 |
commit | 631a5bdd72e2825bf97994043506f87eecb1f055 (patch) | |
tree | b59d04a0ae45c696464204170598fbdff5f7b74f /core | |
parent | 4379844e4b8a4fd3f5723cd6af869cf157d98fc9 (diff) | |
download | stringmetric-631a5bdd72e2825bf97994043506f87eecb1f055.tar.gz stringmetric-631a5bdd72e2825bf97994043506f87eecb1f055.tar.bz2 stringmetric-631a5bdd72e2825bf97994043506f87eecb1f055.zip |
Favored CompareTuple over two character array parameters.
Diffstat (limited to 'core')
-rwxr-xr-x | core/source/core/scala/org/hashtree/stringmetric/HammingMetric.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/source/core/scala/org/hashtree/stringmetric/HammingMetric.scala b/core/source/core/scala/org/hashtree/stringmetric/HammingMetric.scala index 85795b6..0a7ebd3 100755 --- a/core/source/core/scala/org/hashtree/stringmetric/HammingMetric.scala +++ b/core/source/core/scala/org/hashtree/stringmetric/HammingMetric.scala @@ -21,11 +21,11 @@ object HammingMetric extends StringMetric { )(new StringCleanerDelegate) } - private[this] def hamming(ca1: Array[Char], ca2: Array[Char]) = { - require(ca1.length > 0) - require(ca2.length > 0) - require(ca1.length == ca2.length) + private[this] def hamming(ct: CompareTuple) = { + require(ct._1.length > 0) + require(ct._2.length > 0) + require(ct._1.length == ct._2.length) - ca1.zip(ca2).count(t => t._1 != t._2) + ct._1.zip(ct._2).count(t => t._1 != t._2) } }
\ No newline at end of file |