From ba694719d46b49e1a75bda9ef43a57b4d8a22819 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Tue, 14 May 2024 13:20:06 -0500 Subject: [PATCH] Further improvement - return None if there are no non-zero stats on this round. --- src/rust/lts_client/src/collector/quick_drops/stats_diff.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rust/lts_client/src/collector/quick_drops/stats_diff.rs b/src/rust/lts_client/src/collector/quick_drops/stats_diff.rs index d92edd0f..174c4622 100644 --- a/src/rust/lts_client/src/collector/quick_drops/stats_diff.rs +++ b/src/rust/lts_client/src/collector/quick_drops/stats_diff.rs @@ -90,7 +90,11 @@ impl CakeTracker { up.retain(|u| u.drops > 0 || u.marks > 0); down.retain(|d| d.drops > 0 || d.marks > 0); - Some((up, down)) + if up.is_empty() && down.is_empty() { + None + } else { + Some((up, down)) + } } } }