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:
Jason Zaugg 2018-02-20 18:50:22 +10:00
parent 69fb352fa1
commit 4f2933d364
1 changed files with 1 additions and 1 deletions

View File

@ -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 = {