Avoid tens of thousands of duplicated "TypeFuntions.const(())" strings

This commit is contained in:
Jason Zaugg 2020-05-07 10:53:52 +10:00 committed by Eugene Yokota
parent f5eae27c69
commit 43cc55a24c
1 changed files with 2 additions and 1 deletions

View File

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