Changeset 9950


Ignore:
Timestamp:
2005-05-25T14:14:50+12:00 (19 years ago)
Author:
jrm21
Message:

minor change to while loop, slightly more efficient but no semantic difference

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/display.cpp

    r9593 r9950  
    16321632  text_tlist::iterator packageend = packagelist.end();
    16331633  mvalue *macrovalue = NULL;
    1634   while ((macrovalue == NULL) && (packagehere != packageend))
     1634  while (packagehere != packageend)
    16351635    {
    16361636      // first look in the currentmacros
    16371637      macrovalue = currentmacros->macro_find(*packagehere, macroname);
    1638       if (macrovalue == NULL)
    1639     macrovalue = currentmacros->macro_find("Style", macroname);
     1638      if (macrovalue != NULL)
     1639    break;
     1640
     1641      macrovalue = currentmacros->macro_find("Style", macroname);
     1642      if (macrovalue != NULL)
     1643    break;
    16401644
    16411645      // look in the collection specific macros
    1642       if (macrovalue == NULL) {
    1643     macrovalue = macro_find(collectionmacros,*packagehere,macroname);
    1644       }
     1646      macrovalue = macro_find(collectionmacros,*packagehere,macroname);
     1647      if (macrovalue != NULL)
     1648    break;
    16451649
    16461650      // and again in the collection specific package "Style"
    1647       if (macrovalue == NULL) {
    1648     macrovalue = macro_find(collectionmacros,(char*)"Style",macroname);
    1649       }
     1651      macrovalue = macro_find(collectionmacros,(char*)"Style",macroname);
     1652      if (macrovalue != NULL)
     1653    break;
    16501654
    16511655      // look in the default macros
    1652       if (macrovalue == NULL) {
    1653     macrovalue = macro_find(defaultmacros,*packagehere,macroname);
    1654       }
     1656      macrovalue = macro_find(defaultmacros,*packagehere,macroname);
     1657      if (macrovalue != NULL)
     1658    break;
    16551659
    16561660      // and again in the package "Style"
    1657       if (macrovalue == NULL) {
    1658     macrovalue = macro_find(defaultmacros,(char*)"Style",macroname);
    1659       }
    1660 
    1661       if (macrovalue == NULL) ++packagehere;
     1661      macrovalue = macro_find(defaultmacros,(char*)"Style",macroname);
     1662      if (macrovalue != NULL)
     1663    break;
     1664      ++packagehere;
    16621665    }
    16631666
Note: See TracChangeset for help on using the changeset viewer.