mirror of https://github.com/sbt/sbt.git
Fix cross multi command performance
In 53788ba356, I changed the cross multi
parser to issue all of the commands sequentially. This caused a
performance regression for many use cases:
https://github.com/sbt/sbt/issues/5321. This commit restores the old
behavior of `+` if the command to run has no arguments.
This commit is contained in:
parent
4207362835
commit
d445590d9d
|
|
@ -194,7 +194,13 @@ object Cross {
|
|||
.sortBy(_._1)
|
||||
commandsByVersion.flatMap {
|
||||
case (v, commands) =>
|
||||
Seq(s"$SwitchCommand $verbose $v!") ++ commands
|
||||
commands match {
|
||||
case Seq(c) => Seq(s"$SwitchCommand $verbose $v! $c")
|
||||
case Seq() => Nil // should be unreachable
|
||||
case multi if fullArgs.isEmpty =>
|
||||
Seq(s"$SwitchCommand $verbose $v! all ${multi.mkString(" ")}")
|
||||
case multi => Seq(s"$SwitchCommand $verbose $v!") ++ multi
|
||||
}
|
||||
}
|
||||
}
|
||||
allCommands.toList ::: CrossRestoreSessionCommand :: captureCurrentSession(state, extracted)
|
||||
|
|
|
|||
Loading…
Reference in New Issue