All Downloads are FREE. Search and download functionalities are using the official Maven repository.

breeze.util.CachedHashCode.scala Maven / Gradle / Ivy

There is a newer version: 1.0
Show newest version
package breeze.util

import scala.runtime.ScalaRunTime

/**
 * Mixin for case classes that compute their hashcode once, and then cache it.
 * Only good if the case class is immutable, and its contents are also immutable "all the way down".
 *
 * @author dlwh
 */
trait CachedHashCode { this: Product =>
  override lazy val hashCode = ScalaRunTime._hashCode(this);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy