Changeset 28968 in project


Ignore:
Timestamp:
05/28/13 09:19:56 (7 years ago)
Author:
Ivan Raikov
Message:

srfi-4-utils: removed redundant merge sort routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-4-utils/trunk/srfi-4-utils.scm

    r28276 r28968  
    314314(define (srfi-4-vector-merge-sort! vector-length vector-ref vector-set! vector-merge! vblit!)
    315315  (lambda (elt< a )
    316     (let ((b (make-f64vector (vector-length a) 0.)))
    317       (let recur ((p 0) (r (vector-length a)))
    318         (if (> (- r p) 2)
    319             (let ((q (+ p (quotient (- r p 1) 2))))
    320               (recur p q)
    321               (recur q r)
    322               (vector-merge! elt< a p q r b p)
    323               (vblit! b p r a p)
    324               )
    325             (let ((v1 (vector-ref a p))
    326                   (v2 (vector-ref a (+ 1 p))))
    327               (if (elt< (+ 1 p) v2 p v1 )
    328                   (begin (vector-set! a p v2)
    329                          (vector-set! a (+ 1 p) v1)))
    330               )
    331             ))
    332       b)
    333     ))
    334 
    335 
    336 (define (srfi-4-vector-merge-sort! vector-length vector-ref vector-set! vector-merge! vblit!)
    337   (lambda (elt< a )
    338     (let* ((n (vector-length a)) (b (make-f64vector n 0.)))
     316    (let* ((n (vector-length a))
     317           (b (make-f64vector n 0.)))
    339318      (let recur ((m 1))
    340319        (if (< m n)
Note: See TracChangeset for help on using the changeset viewer.