diff options
author | Rocky Madden <git@rockymadden.com> | 2012-10-20 15:14:32 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2012-10-20 15:14:32 -0600 |
commit | 153741654bc2186f91d59261715cb9b58340f09a (patch) | |
tree | 898f3b785180d345eb5eff61acee06fe07a317dc /core | |
parent | 0d6679e72d7dd284ab3edeeb7f1e1ae109cdacc9 (diff) | |
download | stringmetric-153741654bc2186f91d59261715cb9b58340f09a.tar.gz stringmetric-153741654bc2186f91d59261715cb9b58340f09a.tar.bz2 stringmetric-153741654bc2186f91d59261715cb9b58340f09a.zip |
Favored companion empty invokation over class empty constructor.
Diffstat (limited to 'core')
-rwxr-xr-x | core/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala | 4 | ||||
-rwxr-xr-x | core/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala b/core/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala index 32315d8..a77811b 100755 --- a/core/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala +++ b/core/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala @@ -38,8 +38,8 @@ object JaroMetric extends StringMetric { private[this] def `match`(ct: CompareTuple[Char]) = { val window = math.abs((math.max(ct._1.length, ct._2.length) / 2f).floor.toInt - 1) - val one = ArrayBuffer[Int]() - val two = HashSet[Int]() + val one = ArrayBuffer.empty[Int] + val two = HashSet.empty[Int] var i = 0 var bi = false diff --git a/core/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala b/core/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala index ab22bac..ade1178 100755 --- a/core/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala +++ b/core/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala @@ -41,7 +41,7 @@ object LevenshteinMetric extends StringMetric { } private[this] final class Memoize[-T, +R](f: T => R) extends (T => R) { - private[this] val map = scala.collection.mutable.Map[T, R]() + private[this] val map = scala.collection.mutable.Map.empty[T, R] def apply(k: T): R = map.getOrElseUpdate(k, f(k)) } |