Skip to content

Commit

Permalink
Fix adding multiple parallel groups being broken
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Feb 16, 2018
1 parent 22fd7b3 commit f459841
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/kotlin/org/sertain/command/Command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public class CommandGroup : CommandBridgeMirror() {

private fun addQueuedCommands() {
// Postfix parallel commands into command groups
for ((index, entry) in entries.toList().withIndex()) {
val prevIndex = index - 1
for (entry in entries.toList()) {
val prevIndex = entries.indexOf(entry) - 1
if (entry.sequential && entries.getOrNull(prevIndex)?.parallel == true) {
// Walk back up the stack to find all linear parallel commands
for ((trace, prev) in entries.slice(0..prevIndex).reversed().withIndex()) {
Expand Down

0 comments on commit f459841

Please sign in to comment.