Changeset 13410


Ignore:
Timestamp:
Jan 26, 2010, 11:06:46 PM (10 years ago)
Author:
gb
Message:

In MAKE-UARRAY-1 (which handles some cases of MAKE-ARRAY), try
to avoid setting the initial element if it's binary 0; if it
isn't, use %INIT-MISC rather than UVSET in a loop.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-utils.lisp

    r13195 r13410  
    10971097  (let ((vector (%alloc-misc size subtype)))  ; may not get here in that case
    10981098    (if initial-element-p
    1099       (dotimes (i (uvsize vector)) (declare (fixnum i))(uvset vector i initial-element))
     1099      (cond ((and (eql subtype target::subtag-simple-base-string)
     1100                  (eql initial-element #\Null)))
     1101            ((and (eql subtype target::subtag-double-float-vector)
     1102                  (eql initial-element 0.0d0)))
     1103            ((and (eql subtype target::subtag-single-float-vector)
     1104                  (eql initial-element 0.0s0)))
     1105            (t (or (eql initial-element 0)
     1106                   (%init-misc initial-element vector))))
    11001107      (if initial-contents-p
    11011108        (if (null dims) (uvset vector 0 initial-contents)
Note: See TracChangeset for help on using the changeset viewer.