summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala2
-rwxr-xr-xcore/source/core/scala/org/hashtree/stringmetric/distance/JaroMetric.scala4
-rwxr-xr-xcore/source/core/scala/org/hashtree/stringmetric/distance/LevenshteinMetric.scala2
3 files changed, 4 insertions, 4 deletions
diff --git a/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala b/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
index a3a0f16..cb13617 100755
--- a/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
+++ b/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
@@ -10,7 +10,7 @@ object OptionMapUtility {
}
def toOptionMap(arguments: List[String]): OptionMap = {
- next(new HashMap[Symbol, String](), arguments)
+ next(HashMap.empty[Symbol, String], arguments)
}
@tailrec
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))
}