From 3866b12b693557e2f8c70476d5289126b1770dad Mon Sep 17 00:00:00 2001 From: hadley31 Date: Fri, 4 Sep 2026 18:03:12 -0400 Subject: [PATCH] fix awaitCompletion method functionality --- commandsv3/src/main/java/org/wpilib/command3/Coroutine.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commandsv3/src/main/java/org/wpilib/command3/Coroutine.java b/commandsv3/src/main/java/org/wpilib/command3/Coroutine.java index 11f262d8f38..d45a1780a92 100644 --- a/commandsv3/src/main/java/org/wpilib/command3/Coroutine.java +++ b/commandsv3/src/main/java/org/wpilib/command3/Coroutine.java @@ -202,10 +202,8 @@ public boolean partialSuccess() { *

This method does nothing if no commands were successfully forked. */ public void awaitCompletion() { - for (Command command : m_forkedCommands) { - if (m_scheduler.isRunning(command)) { - Coroutine.this.yield(); - } + while (m_forkedCommands.stream().anyMatch(m_scheduler::isRunning)) { + Coroutine.this.yield(); } }