From a28428f96ce6add74b0372d2c0e061d19b4a964a Mon Sep 17 00:00:00 2001 From: Adrien Piquerez Date: Sat, 2 Nov 2024 12:46:10 +0100 Subject: [PATCH] Pre-compute hashCode --- main-settings/src/main/scala/sbt/Scope.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main-settings/src/main/scala/sbt/Scope.scala b/main-settings/src/main/scala/sbt/Scope.scala index 907e0d266..d417d63b0 100644 --- a/main-settings/src/main/scala/sbt/Scope.scala +++ b/main-settings/src/main/scala/sbt/Scope.scala @@ -15,6 +15,7 @@ import sbt.internal.util.Util._ import sbt.io.IO import scala.collection.concurrent.TrieMap +import scala.runtime.ScalaRunTime final case class Scope private ( project: ScopeAxis[Reference], @@ -22,6 +23,8 @@ final case class Scope private ( task: ScopeAxis[AttributeKey[?]], extra: ScopeAxis[AttributeMap] ): + override val hashCode = ScalaRunTime._hashCode(this) + def rescope(project: Reference): Scope = copy(project = Select(project)) def rescope(config: ConfigKey): Scope = copy(config = Select(config)) def rescope(task: AttributeKey[?]): Scope = copy(task = Select(task))