From 459be9fbad2cbf04277754d8ba3d40d0a0066715 Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Tue, 7 Jun 2022 09:02:00 +0100 Subject: [PATCH] Tiny simplification --- src/common/MovingMedian.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/common/MovingMedian.h b/src/common/MovingMedian.h index b574deb..c9a60ba 100644 --- a/src/common/MovingMedian.h +++ b/src/common/MovingMedian.h @@ -146,9 +146,8 @@ private: m_sorted[i] = toPut; } else if (toPut < toDrop) { int i = dropIx; - while (i >= 0) { - --i; - if (i < 0 || m_sorted[i] < toPut) { + while (true) { + if (--i < 0 || m_sorted[i] < toPut) { break; } m_sorted[i+1] = m_sorted[i];