Changeset 33361 in project


Ignore:
Timestamp:
05/29/16 07:50:05 (5 years ago)
Author:
Ivan Raikov
Message:

dyn-vector: additional fixes for zero-sized vectors in dynvector->list and make-dynvector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/dyn-vector/trunk/dyn-vector.scm

    r33360 r33361  
    7676 
    7777(define (make-dynvector n dflt)
    78   (make-dvbase (make-vector n dflt) dflt 0))
     78  (if (> n 0)
     79      (make-dvbase (make-vector n dflt) dflt 0)
     80      (list->dynvector '() dflt)))
    7981
    8082(define (dynvector-clear! dv n)
     
    184186  (let ((n     (dvbase-cnt dv))
    185187        (vect  (dvbase-vect dv)))
    186     (vector->list vect 0 n)))
     188    (if (> n 0)
     189        (vector->list vect 0 n)
     190        '())))
    187191
    188192
Note: See TracChangeset for help on using the changeset viewer.