Pre-compute hashCode

This commit is contained in:
Adrien Piquerez 2024-11-02 12:46:10 +01:00
parent 4a429b2fe2
commit a28428f96c
1 changed files with 3 additions and 0 deletions

View File

@ -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))