1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

intset-intersect bugfix

* module/language/cps/intset.scm (intset-intersect): Remove new-leaf
  procedure, inlining to single call site.  An empty intersection
  properly produces #f so that the set can be pruned.
This commit is contained in:
Andy Wingo 2015-07-22 16:59:47 +02:00
parent ff2beb186e
commit 2df454b95b

View file

@ -102,7 +102,6 @@
(root transient-intset-root set-transient-intset-root!)
(edit transient-intset-edit set-transient-intset-edit!))
(define (new-leaf) 0)
(define-inlinable (clone-leaf-and-set leaf i val)
(if val
(if leaf
@ -573,10 +572,10 @@
(else (make-intset a-min a-shift root)))))))))
(define (intset-intersect a b)
(define tmp (new-leaf))
;; Intersect leaves.
(define (intersect-leaves a b)
(logand a b))
(let ((leaf (logand a b)))
(if (eqv? leaf 0) #f leaf)))
;; Intersect A and B from index I; the result will be fresh.
(define (intersect-branches/fresh shift a b i fresh)
(let lp ((i 0))