From e210cd9d00dca83eda1a51b7006a759a05168591 Mon Sep 17 00:00:00 2001 From: Pavel Panchekha Date: Tue, 26 Nov 2024 21:22:04 -0700 Subject: [PATCH] Terminate the iteration in regimes --- src/core/regimes.rkt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/regimes.rkt b/src/core/regimes.rkt index 96a2115bd..17b6803eb 100644 --- a/src/core/regimes.rkt +++ b/src/core/regimes.rkt @@ -308,6 +308,9 @@ (let loop ([i (- number-of-points 1)]) (define alt-idx (vector-ref result-alt-idxs i)) (define next (vector-ref result-prev-idxs i)) - (cons (si alt-idx (+ i 1)) (loop next))))) + (cons (si alt-idx (+ i 1)) + (if (= next number-of-points) + '() + (loop next)))))) (require (submod "." core))