summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--starling/ring-buffer.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/starling/ring-buffer.scm b/starling/ring-buffer.scm
index 1138755..e4f18d7 100644
--- a/starling/ring-buffer.scm
+++ b/starling/ring-buffer.scm
@@ -54,11 +54,11 @@
(vector-length v))))))
(define (ring-buffer-clear! ring)
- (let ((l (ring-buffer-length ring))
- (v (ring-buffer-vector ring)))
+ (let ((v (ring-buffer-vector ring)))
(set-ring-buffer-head! ring 0)
(set-ring-buffer-tail! ring 0)
+ (set-ring-buffer-length! ring 0)
(let loop ((i 0))
- (when (< i l)
+ (when (< i (vector-length v))
(vector-set! v i #f)
(loop (+ i 1))))))