mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
Intset-next micro-optimizations
* module/language/cps/intset.scm (intset-next): Micro-optimizations.
This commit is contained in:
parent
9c8d2b85e8
commit
048d5d340e
1 changed files with 6 additions and 6 deletions
|
@ -236,20 +236,20 @@
|
|||
(define (visit-branch node shift i)
|
||||
(let lp ((i i) (idx (logand (ash i (- shift)) *branch-mask*)))
|
||||
(and (< idx *branch-size*)
|
||||
(or (visit-node (vector-ref node idx) shift i)
|
||||
(or (let ((node (vector-ref node idx)))
|
||||
(and node (visit-node node shift i)))
|
||||
(let ((inc (ash 1 shift)))
|
||||
(lp (+ (round-down i shift) inc) (1+ idx)))))))
|
||||
(define (visit-node node shift i)
|
||||
(and node
|
||||
(if (= shift *leaf-bits*)
|
||||
(visit-leaf node i)
|
||||
(visit-branch node (- shift *branch-bits*) i))))
|
||||
(if (= shift *leaf-bits*)
|
||||
(visit-leaf node i)
|
||||
(visit-branch node (- shift *branch-bits*) i)))
|
||||
(match bs
|
||||
(($ <intset> min shift root)
|
||||
(let ((i (if (and i (< min i))
|
||||
(- i min)
|
||||
0)))
|
||||
(and (< i (ash 1 shift))
|
||||
(and root (< i (ash 1 shift))
|
||||
(let ((i (visit-node root shift i)))
|
||||
(and i (+ min i))))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue