Merge pull request #5545 from eed3si9n/fport/duplicated-strings

[fport] Avoid tens of thousands of duplicated "TypeFuntions.const(())" strings
This commit is contained in:
eugene yokota 2020-05-09 15:04:46 -04:00 committed by GitHub
commit 9eedbce815
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}