From 97028cb7f8bb9dc80a53676c48f3e453575a4e01 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 21 Sep 2011 22:54:46 -0400 Subject: [PATCH] drop unused 'original' field from task info --- tasks/standard/Action.scala | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tasks/standard/Action.scala b/tasks/standard/Action.scala index 67b1b8804..9b13404af 100644 --- a/tasks/standard/Action.scala +++ b/tasks/standard/Action.scala @@ -22,14 +22,13 @@ object Task type Results[HL <: HList] = KList[Result, HL] } -final case class Task[T](info: Info[T], work: Action[T]) +final case class Task[T](info: Info, work: Action[T]) { - def original = info.original getOrElse this - override def toString = info.name orElse original.info.name getOrElse ("Task(" + info + ")") + override def toString = info.name getOrElse ("Task(" + info + ")") override def hashCode = info.hashCode } /** `original` is used during transformation only.*/ -final case class Info[T](attributes: AttributeMap = AttributeMap.empty, original: Option[Task[T]] = None) +final case class Info(attributes: AttributeMap = AttributeMap.empty) { import Info._ def name = attributes.get(Name) @@ -39,10 +38,10 @@ final case class Info[T](attributes: AttributeMap = AttributeMap.empty, original def set[T](key: AttributeKey[T], value: T) = copy(attributes = this.attributes.put(key, value)) override def toString = - if(attributes.isEmpty && original.isEmpty) + if(attributes.isEmpty) "_" else - attributes.toString + (original match { case Some(o) => ", original: " + o; case None => "" }) + attributes.toString } object Info {