Revision: 54481
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54481&view=rev
Author:   bob1961
Date:     2013-02-26 12:54:02 +0000 (Tue, 26 Feb 2013)
Log Message:
-----------
Simplify the code a bit in _ged_combadd2().

Modified Paths:
--------------
    brlcad/trunk/src/libged/comb.c

Modified: brlcad/trunk/src/libged/comb.c
===================================================================
--- brlcad/trunk/src/libged/comb.c      2013-02-26 12:30:14 UTC (rev 54480)
+++ brlcad/trunk/src/libged/comb.c      2013-02-26 12:54:02 UTC (rev 54481)
@@ -250,8 +250,8 @@
     }
 
     /* make space for an extra leaf */
-    curr_count = db_tree_nleaves(comb->tree) + 1;
-    node_count = curr_count + argc - 1;
+    curr_count = db_tree_nleaves(comb->tree);
+    node_count = curr_count + argc;
     tree_list = (struct rt_tree_array *)bu_calloc(node_count, sizeof(struct 
rt_tree_array), "tree list");
 
     /* flatten tree */
@@ -270,22 +270,22 @@
        /* insert new member at end */
        switch (relation) {
        case '+':
-           tree_list[curr_count - 1].tl_op = OP_INTERSECT;
+           tree_list[curr_count].tl_op = OP_INTERSECT;
            break;
        case '-':
-           tree_list[curr_count - 1].tl_op = OP_SUBTRACT;
+           tree_list[curr_count].tl_op = OP_SUBTRACT;
            break;
        default:
            if (relation != 'u') {
                bu_vls_printf(gedp->ged_result_str, "unrecognized relation 
(assume UNION)\n");
            }
-           tree_list[curr_count - 1].tl_op = OP_UNION;
+           tree_list[curr_count].tl_op = OP_UNION;
            break;
        }
 
        /* make new leaf node, and insert at end of list */
        RT_GET_TREE(tp, &rt_uniresource);
-       tree_list[curr_count-1].tl_tree = tp;
+       tree_list[curr_count].tl_tree = tp;
        tp->tr_l.tl_op = OP_DB_LEAF;
        tp->tr_l.tl_name = bu_strdup(objp->d_namep);
        tp->tr_l.tl_mat = (matp_t)NULL;

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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to