mirror of https://github.com/sbt/sbt.git
Cache the hashCode of Configuration
I noticed this was showing up in profiles when SBT's task engine was using Keys, etc (that contain Configurations) in HashMap's. Let's cache it instead. I don't think there is a need to use a lazy val for this, we can compute it eagerly.
This commit is contained in:
parent
69fb352fa1
commit
4f2933d364
|
|
@ -31,7 +31,7 @@ final class Configuration private[sbt] (
|
|||
(this.transitive == x.transitive)
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
override val hashCode: Int = {
|
||||
37 * (37 * (37 * (37 * (37 * (37 * (17 + id.##) + name.##) + description.##) + isPublic.##) + extendsConfigs.##) + transitive.##)
|
||||
}
|
||||
override def toString: String = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue