use 'distinct' for State.++ to ensure commands are not duplicated

This commit is contained in:
Mark Harrah 2011-03-19 00:04:07 -04:00
parent 6215819890
commit 7c7af7c998
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ object State
s.copy(commands = s.commands.drop(1))
def ::: (newCommands: Seq[String]): State = s.copy(commands = newCommands ++ s.commands)
def :: (command: String): State = (command :: Nil) ::: this
def ++ (newCommands: Seq[Command]): State = s.copy(processors = s.processors ++ newCommands)
def ++ (newCommands: Seq[Command]): State = s.copy(processors = (s.processors ++ newCommands).distinct)
def + (newCommand: Command): State = this ++ (newCommand :: Nil)
def baseDir: File = s.configuration.baseDirectory
def setNext(n: Next.Value) = s.copy(next = n)