Changeset 39727 in project


Ignore:
Timestamp:
03/16/21 22:38:25 (5 weeks ago)
Author:
Kon Lovett
Message:

fix push-back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/mailbox/trunk/inline-queue.scm

    r39726 r39727  
    7575
    7676(define-inline (%queue-unlimited-push-back! q v)
    77   (%queue-unlimited-add! q v)
    78   #; ;why bother
    7977  (let ((newlist (cons v (%queue-unlimited-first-pair q))))
    8078    (%queue-unlimited-first-pair-set! q newlist)
     
    8482
    8583(define-inline (%queue-unlimited-push-back-list! q ls)
    86   (for-each (lambda (v) (%queue-unlimited-add! q v)) (reverse ls))
    87   #; ;why bother
    8884  (let ((newlist (append! (list-copy ls) (%queue-unlimited-first-pair q))))
    8985    (%queue-unlimited-first-pair-set! q newlist)
     
    196192
    197193(define-inline (%queue-limited-push-back! q v)
    198   (%queue-limited-add! q v) )
     194  (%queue-limited-start-set! q (%queue-limited-index-dec q (%queue-limited-start q)))
     195  (%queue-limited-poke! q (%queue-limited-start q) v) )
    199196
    200197(define-inline (%queue-limited-push-back-list! q ls)
    201   (for-each (lambda (v) (%queue-limited-add! q v)) (reverse ls)) )
     198  ;NOTE move "down" from start to start-1; kinda like extract below
     199  (for-each (lambda (v) (%queue-limited-push-back! q v)) (reverse ls)) )
    202200
    203201;index
Note: See TracChangeset for help on using the changeset viewer.