[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 08/13: intset-intersect bugfix

From: Andy Wingo
Subject: [Guile-commits] 08/13: intset-intersect bugfix
Date: Wed, 22 Jul 2015 15:32:28 +0000

wingo pushed a commit to branch master
in repository guile.

commit 2df454b95b67029e28bbe041885001ce4a14adfd
Author: Andy Wingo <address@hidden>
Date:   Wed Jul 22 16:59:47 2015 +0200

    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.
 module/language/cps/intset.scm |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/module/language/cps/intset.scm b/module/language/cps/intset.scm
index 8c7a23b..bb35a23 100644
--- a/module/language/cps/intset.scm
+++ b/module/language/cps/intset.scm
@@ -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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]