From 43cc55a24ca605e03a2a731ef43c496e9698594a Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 7 May 2020 10:53:52 +1000 Subject: [PATCH] Avoid tens of thousands of duplicated "TypeFuntions.const(())" strings --- tasks-standard/src/main/scala/sbt/Action.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks-standard/src/main/scala/sbt/Action.scala b/tasks-standard/src/main/scala/sbt/Action.scala index 9be95676e..603eb5fc3 100644 --- a/tasks-standard/src/main/scala/sbt/Action.scala +++ b/tasks-standard/src/main/scala/sbt/Action.scala @@ -80,7 +80,7 @@ final case class Task[T](info: Info[T], work: Action[T]) { */ final case class Info[T]( attributes: AttributeMap = AttributeMap.empty, - post: T => AttributeMap = const(AttributeMap.empty) + post: T => AttributeMap = Info.defaultAttributeMap ) { import Info._ def name = attributes.get(Name) @@ -96,4 +96,5 @@ final case class Info[T]( object Info { val Name = AttributeKey[String]("name") val Description = AttributeKey[String]("description") + val defaultAttributeMap = const(AttributeMap.empty) }