diff options
Diffstat (limited to 'core')
-rwxr-xr-x | core/src/main/scala/com/rockymadden/stringmetric/Algorithm.scala | 8 | ||||
-rwxr-xr-x | core/src/main/scala/com/rockymadden/stringmetric/Metric.scala | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/core/src/main/scala/com/rockymadden/stringmetric/Algorithm.scala b/core/src/main/scala/com/rockymadden/stringmetric/Algorithm.scala index 71796d7..96cf142 100755 --- a/core/src/main/scala/com/rockymadden/stringmetric/Algorithm.scala +++ b/core/src/main/scala/com/rockymadden/stringmetric/Algorithm.scala @@ -35,12 +35,12 @@ object Algorithm { final class StringAlgorithmDecorator(val sa: StringAlgorithm) { val withTransform: (StringTransform => StringAlgorithm) = (st) => new StringAlgorithm { - private[this] val self: StringAlgorithm = sa - private[this] val transform: StringTransform = st + private val base: StringAlgorithm = sa + private val transform: StringTransform = st - override def compute(a: Array[Char]): Option[Array[Char]] = self.compute(transform(a)) + override def compute(a: Array[Char]): Option[Array[Char]] = base.compute(transform(a)) - override def compute(a: String): Option[String] = self.compute(transform(a.toCharArray)).map(_.mkString) + override def compute(a: String): Option[String] = base.compute(transform(a.toCharArray)).map(_.mkString) } } } diff --git a/core/src/main/scala/com/rockymadden/stringmetric/Metric.scala b/core/src/main/scala/com/rockymadden/stringmetric/Metric.scala index b48da74..03a0425 100755 --- a/core/src/main/scala/com/rockymadden/stringmetric/Metric.scala +++ b/core/src/main/scala/com/rockymadden/stringmetric/Metric.scala @@ -64,14 +64,14 @@ object Metric { final class StringMetricDecorator[A](val sm: StringMetric[A]) { val withTransform: (StringTransform => StringMetric[A]) = (st) => new StringMetric[A] { - private[this] val self: StringMetric[A] = sm - private[this] val transform: StringTransform = st + private val base: StringMetric[A] = sm + private val transform: StringTransform = st override def compare(a: Array[Char], b: Array[Char]): Option[A] = - self.compare(transform(a), transform(b)) + base.compare(transform(a), transform(b)) override def compare(a: String, b: String): Option[A] = - self.compare(transform(a.toCharArray), transform(b.toCharArray)) + base.compare(transform(a.toCharArray), transform(b.toCharArray)) } } } |