]> gitweb.factorcode.org Git - factor.git/commitdiff
math.intervals: simplify interval-bitand.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 31 Oct 2019 17:45:36 +0000 (10:45 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 31 Oct 2019 17:45:36 +0000 (10:45 -0700)
basis/math/intervals/intervals.factor

index 8c4c1a8e343b369bbe4486b613c10d30da9d19ef..63fa4582fd3df8b331fccd46efc107daa307327f 100644 (file)
@@ -422,11 +422,13 @@ PRIVATE>
                     to>> first 0 swap [a,b]
                 ]
             }
-            {
-                [ 2dup [ interval-negative? ] both? ]
-                [ [ min-lower-bound bit-weight neg ] [ min-upper-bound ] 2bi [a,b] ]
-            }
-            [ [ min-lower-bound bit-weight neg ] [ max-upper-bound ] 2bi [a,b] ]
+            [
+                [ min-lower-bound bit-weight neg ]
+                [
+                    2dup [ interval-negative? ] both?
+                    [ min-upper-bound ] [ max-upper-bound ] if
+                ] 2bi [a,b]
+            ]
         } cond
     ] do-empty-interval ;