summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee/array-list.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/chickadee/array-list.scm b/chickadee/array-list.scm
index da450c8..0150cce 100644
--- a/chickadee/array-list.scm
+++ b/chickadee/array-list.scm
@@ -17,6 +17,7 @@
(define-module (chickadee array-list)
#:use-module (ice-9 format)
+ #:use-module (rnrs base)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (srfi srfi-43)
@@ -72,7 +73,8 @@
(define (expand-array-list! array-list)
(let* ((old-vec (array-list-vector array-list))
- (new-size (* (vector-length old-vec) 2))
+ (old-size (vector-length old-vec))
+ (new-size (+ old-size (div old-size 2)))
(new-vec (make-vector new-size)))
(vector-copy! new-vec 0 old-vec)
(set-array-list-vector! array-list new-vec)))