mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
Inline some helpers in intset.scm.
* module/language/cps/intset.scm (round-down): Inline. (clone-branch-and-set): Inline, and inline the vector-move-left!.
This commit is contained in:
parent
9091454c2e
commit
f56f580a4a
1 changed files with 7 additions and 3 deletions
|
@ -117,9 +117,13 @@
|
|||
(let ((vec (make-vector *branch-size-with-edit* #f)))
|
||||
(when edit (vector-set! vec *edit-index* edit))
|
||||
vec))
|
||||
(define (clone-branch-and-set branch i elt)
|
||||
(define-inlinable (clone-branch-and-set branch i elt)
|
||||
(let ((new (new-branch #f)))
|
||||
(when branch (vector-move-left! branch 0 *branch-size* new 0))
|
||||
(when branch
|
||||
(let lp ((n 0))
|
||||
(when (< n *branch-size*)
|
||||
(vector-set! new n (vector-ref branch n))
|
||||
(lp (1+ n)))))
|
||||
(vector-set! new i elt)
|
||||
new))
|
||||
(define-inlinable (assert-readable! root-edit)
|
||||
|
@ -136,7 +140,7 @@
|
|||
(and (not (vector-ref branch i))
|
||||
(lp (1+ i))))))
|
||||
|
||||
(define (round-down min shift)
|
||||
(define-inlinable (round-down min shift)
|
||||
(logand min (lognot (1- (ash 1 shift)))))
|
||||
|
||||
(define empty-intset (make-intset 0 *leaf-bits* #f))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue