Revision: 70821
          http://sourceforge.net/p/brlcad/code/70821
Author:   brlcad
Date:     2018-03-14 01:07:01 +0000 (Wed, 14 Mar 2018)
Log Message:
-----------
remove more first char 'optimizations'.  highly doubtful these have any 
measurable impact and (IF they did) it's something BU_STR_EQUAL could do 
everywhere automatically.  skipped the dubious db_lookup ones for now too, just 
because they have comments.

Modified Paths:
--------------
    brlcad/trunk/src/librt/bbox.c
    brlcad/trunk/src/librt/db5_types.c
    brlcad/trunk/src/libtclcad/tclcad_obj.c

Modified: brlcad/trunk/src/librt/bbox.c
===================================================================
--- brlcad/trunk/src/librt/bbox.c       2018-03-14 00:52:13 UTC (rev 70820)
+++ brlcad/trunk/src/librt/bbox.c       2018-03-14 01:07:01 UTC (rev 70821)
@@ -123,14 +123,13 @@
     for (BU_LIST_FOR(regp, region, &(rtip->HeadRegion))) {
        char *cp;
        /* First, check for a match of the full path */
-       if (*reg_base == regp->reg_name[0] &&
-           BU_STR_EQUAL(reg_base, regp->reg_name)) {
+       if (BU_STR_EQUAL(reg_base, regp->reg_name)) {
            bu_free(reg_base, "reg_base free");
            return regp;
        }
        /* Second, check for a match of the database node name */
        cp = bu_basename(regp->reg_name, NULL);
-       if (*cp == *reg_name && BU_STR_EQUAL(cp, reg_name)) {
+       if (BU_STR_EQUAL(cp, reg_name)) {
            bu_free(reg_base, "reg_base free");
            bu_free(cp, "cp free");
            return regp;

Modified: brlcad/trunk/src/librt/db5_types.c
===================================================================
--- brlcad/trunk/src/librt/db5_types.c  2018-03-14 00:52:13 UTC (rev 70820)
+++ brlcad/trunk/src/librt/db5_types.c  2018-03-14 01:07:01 UTC (rev 70821)
@@ -196,7 +196,7 @@
     for (tp = (struct db5_type *) type_table;
         tp->major_code != DB5_MAJORTYPE_RESERVED;
         ++tp) {
-       if ((*(tp->tag) == *tag) && (BU_STR_EQUAL(tp->tag, tag))) {
+       if (BU_STR_EQUAL(tp->tag, tag)) {
            *major = tp->major_code;
            *minor = tp->minor_code;
            return 0;
@@ -214,8 +214,7 @@
     for (tp = (struct db5_type *) type_table;
         tp->major_code != DB5_MAJORTYPE_RESERVED;
         ++tp) {
-       if ((*(tp->description) == *descrip)
-           && (BU_STR_EQUAL(tp->description, descrip))) {
+       if (BU_STR_EQUAL(tp->description, descrip)) {
            *major = tp->major_code;
            *minor = tp->minor_code;
            return 0;

Modified: brlcad/trunk/src/libtclcad/tclcad_obj.c
===================================================================
--- brlcad/trunk/src/libtclcad/tclcad_obj.c     2018-03-14 00:52:13 UTC (rev 
70820)
+++ brlcad/trunk/src/libtclcad/tclcad_obj.c     2018-03-14 01:07:01 UTC (rev 
70821)
@@ -1487,8 +1487,7 @@
     current_top = top;
 
     for (ctp = to_cmds; ctp->to_name != (char *)0; ctp++) {
-       if (ctp->to_name[0] == argv[1][0] &&
-           BU_STR_EQUAL(ctp->to_name, argv[1])) {
+       if (BU_STR_EQUAL(ctp->to_name, argv[1])) {
            struct ged *gedp = top->to_gop->go_gedp;
            ret = (*ctp->to_wrapper_func)(gedp, argc-1, (const char **)argv+1, 
ctp->to_func, ctp->to_usage, ctp->to_maxargs);
            break;

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