mirror of
https://github.com/sbt/sbt.git
synced 2026-08-29 01:24:09 +02:00
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:
committed by
Eugene Yokota
parent
f288572f70
commit
b0758e99c8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user