Skip to content

Commit

Permalink
Fix flatten-vector->list on empty vectors.
Browse files Browse the repository at this point in the history
Closes #976.

Complements of Bradley Lucier.
  • Loading branch information
ashinn committed May 27, 2024
1 parent 2b1d2d9 commit 11984c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/srfi/231/transforms.scm
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,9 @@
(define (flatten-vector->list vec d)
(cond
((not (vector? vec)) '())
((and (positive? d) (vector? (vector-ref vec 0)))
((and (positive? d)
(positive? (vector-length vec))
(vector? (vector-ref vec 0)))
(append-map (lambda (x) (flatten-vector->list x (- d 1)))
(vector->list vec)))
(else (vector->list vec))))
Expand Down

0 comments on commit 11984c6

Please sign in to comment.