Revision: 70067
          http://sourceforge.net/p/brlcad/code/70067
Author:   brlcad
Date:     2017-08-10 13:22:00 +0000 (Thu, 10 Aug 2017)
Log Message:
-----------
vasco noticed that TrueRg aka trueregp is not actually used for anything.  
looking through the history, it looks like this goes WAY back circa 1989 rt v2 
era probably intended to provide the caller with additional region info for xor 
and overlapping cases, but never actually used or completed.  this eliminates 
six branch conditions from the boolean evaluation path.  no impact on benchmark.

Modified Paths:
--------------
    brlcad/trunk/src/librt/bool.c

Modified: brlcad/trunk/src/librt/bool.c
===================================================================
--- brlcad/trunk/src/librt/bool.c       2017-08-10 00:58:22 UTC (rev 70066)
+++ brlcad/trunk/src/librt/bool.c       2017-08-10 13:22:00 UTC (rev 70067)
@@ -1266,10 +1266,9 @@
  * -1 tree is in error (GUARD)
  */
 HIDDEN int
-bool_eval(register union tree *treep, struct partition *partp, struct region 
**trueregp, struct resource *resp)
+bool_eval(register union tree *treep, struct partition *partp, struct resource 
*resp)
 /* Tree to evaluate */
 /* Partition to evaluate */
-/* XOR true (and overlap) return */
 /* resource pointer for this CPU */
 {
     static union tree tree_not[MAX_PSW];       /* for OP_NOT nodes */
@@ -1282,10 +1281,7 @@
     RT_CK_TREE(treep);
     RT_CK_PT(partp);
     RT_CK_RESOURCE(resp);
-    if (treep->tr_op != OP_XOR)
-       trueregp[0] = treep->tr_regionp;
-    else
-       trueregp[0] = trueregp[1] = REGION_NULL;
+
     while ((sp = resp->re_boolstack) == (union tree **)0)
        rt_bool_growstack(resp);
     stackend = &(resp->re_boolstack[resp->re_boolslen]);
@@ -1364,12 +1360,10 @@
            goto pop;
        case OP_XOR:
            if (ret) {
-               /* lhs was true, rhs better not be, or we have an
+               /* lhs was true, rhs better not be or we have an
                 * overlap condition.  Rewrite as guard node followed
                 * by rhs.
                 */
-               if (treep->tr_b.tb_left->tr_regionp)
-                   trueregp[0] = treep->tr_b.tb_left->tr_regionp;
                tree_guard[resp->re_cpu].tr_op = OP_GUARD;
                treep = treep->tr_b.tb_right;
                *sp++ = treep;          /* temp val for guard node */
@@ -1394,8 +1388,6 @@
             */
            if (ret) {
                /* stacked temp val: rhs */
-               if (sp[-1]->tr_regionp)
-                   trueregp[1] = sp[-1]->tr_regionp;
                return -1;      /* GUARD error */
            }
            ret = BOOL_TRUE;
@@ -1403,14 +1395,9 @@
            goto pop;
        case OP_XNOP:
            /*
-            * Special NOP for XOR.  lhs was false.  If rhs is true,
-            * take note of its regionp.
+            * Special NOP for XOR.  lhs was false.
             */
            sp--;                       /* pop temp val */
-           if (ret) {
-               if ((*sp)->tr_regionp)
-                   trueregp[0] = (*sp)->tr_regionp;
-           }
            goto pop;
        default:
            bu_log("bool_eval:  bad pop op [%d]\n", treep->tr_op);
@@ -1424,7 +1411,6 @@
 rt_boolfinal(struct partition *InputHdp, struct partition *FinalHdp, fastf_t 
startdist, fastf_t enddist, struct bu_ptbl *regiontable, struct application 
*ap, const struct bu_bitv *solidbits)
 {
     struct region *lastregion = (struct region *)NULL;
-    struct region *TrueRg[2];
     register struct partition *pp;
     register int claiming_regions;
     int hits_avail = 0;
@@ -1683,8 +1669,7 @@
                    lastregion = regp;
                    continue;
                }
-               if (bool_eval(regp->reg_treetop, pp, TrueRg,
-                             ap->a_resource) == BOOL_FALSE) {
+               if (bool_eval(regp->reg_treetop, pp, ap->a_resource) == 
BOOL_FALSE) {
                    if (RT_G_DEBUG&DEBUG_PARTITION)
                        bu_log("BOOL_FALSE\n");
                    /* Null out non-claiming region's pointer */

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to