summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/array-list.scm10
1 files changed, 4 insertions, 6 deletions
diff --git a/chickadee/array-list.scm b/chickadee/array-list.scm
index e09cded..6c1e6f1 100644
--- a/chickadee/array-list.scm
+++ b/chickadee/array-list.scm
@@ -139,18 +139,16 @@
*unspecified*)
(define (array-list-for-each proc array-list)
- (let ((size (array-list-size array-list))
- (vec (array-list-vector array-list)))
+ (let ((vec (array-list-vector array-list)))
(let loop ((i 0))
- (when (< i size)
+ (when (< i (array-list-size array-list))
(proc i (vector-ref vec i))
(loop (1+ i))))))
(define (array-list-fold proc init array-list)
- (let ((size (array-list-size array-list))
- (vec (array-list-vector array-list)))
+ (let ((vec (array-list-vector array-list)))
(let loop ((i 0)
(prev init))
- (if (< i size)
+ (if (< i (size (array-list-size array-list)))
(loop (1+ i) (proc i (vector-ref vec i) prev))
prev))))