From 50cc62f2a97aea451d32e4edd7bda40519248833 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Fri, 26 Jan 2024 14:22:35 +0100 Subject: [PATCH] Only break if there is no active unit. --- src/units/combine.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/units/combine.rs b/src/units/combine.rs index 2d5ae47..e432767 100644 --- a/src/units/combine.rs +++ b/src/units/combine.rs @@ -41,7 +41,7 @@ impl Any { None; self.sources.len() ]; - // Outer loop picks a new source. + // Outer loop picks a new active source. loop { let new_idx = self.pick(curr_idx); if new_idx != curr_idx { @@ -68,7 +68,7 @@ impl Any { } } - // Inner loop works the source until it stalls + // Inner loop collects updates until the active unit stalls loop { let (res, idx, _) = { let res = select( @@ -95,7 +95,7 @@ impl Any { if Some(idx) == curr_idx { gate.update_data(update.clone()).await; } - else { + else if curr_idx.is_none() { // We currently don’t have an active source but // there was an update. Break to pick a new active // source.