dbertoni    2002/07/24 16:19:43

  Modified:    c/src/XSLT CountersTable.hpp ElemForEach.cpp ElemUse.cpp
                        NamespacesHandler.cpp NodeSorter.cpp Stylesheet.hpp
                        StylesheetExecutionContextDefault.cpp
                        StylesheetHandler.cpp StylesheetRoot.cpp
                        StylesheetRoot.hpp VariablesStack.cpp
  Log:
  Use empty() instead of size() != 0.
  
  Revision  Changes    Path
  1.4       +2 -2      xml-xalan/c/src/XSLT/CountersTable.hpp
  
  Index: CountersTable.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/CountersTable.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CountersTable.hpp 14 Jun 2001 19:15:37 -0000      1.3
  +++ CountersTable.hpp 24 Jul 2002 23:19:43 -0000      1.4
  @@ -163,7 +163,7 @@
        XalanNode*
        getLast() const
        {
  -             return m_countNodes.size() == 0 ? 0 : m_countNodes.back();
  +             return m_countNodes.empty() == true ? 0 : m_countNodes.back();
        }
   };
   
  
  
  
  1.26      +1 -1      xml-xalan/c/src/XSLT/ElemForEach.cpp
  
  Index: ElemForEach.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemForEach.cpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ElemForEach.cpp   10 Jul 2002 05:09:48 -0000      1.25
  +++ ElemForEach.cpp   24 Jul 2002 23:19:43 -0000      1.26
  @@ -243,7 +243,7 @@
                BorrowReturnNodeSorter  sorter(executionContext);
   
                NodeSortKeyVectorType&  keys = sorter->getSortKeys();
  -             assert(keys.size() == 0);
  +             assert(keys.empty() == true);
   
                CollectionClearGuard<NodeSortKeyVectorType>             
guard(keys);
   
  
  
  
  1.18      +2 -2      xml-xalan/c/src/XSLT/ElemUse.cpp
  
  Index: ElemUse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemUse.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ElemUse.cpp       2 Apr 2002 05:38:25 -0000       1.17
  +++ ElemUse.cpp       24 Jul 2002 23:19:43 -0000      1.18
  @@ -116,7 +116,7 @@
                        StylesheetConstructionContext&  constructionContext,
                        const NamespacesHandler&                
theParentHandler)
   {
  -     if (m_attributeSetsNames.size() != 0)
  +     if (m_attributeSetsNames.empty() == false)
        {
                canGenerateAttributes(true);
        }
  @@ -142,7 +142,7 @@
   {
        ElemTemplateElement::execute(executionContext);
   
  -     if(applyAttributeSets == true && 0 != m_attributeSetsNames.size())
  +     if(applyAttributeSets == true && m_attributeSetsNames.empty() == false)
        {
                assert(canGenerateAttributes() == true);
   
  
  
  
  1.20      +12 -12    xml-xalan/c/src/XSLT/NamespacesHandler.cpp
  
  Index: NamespacesHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NamespacesHandler.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- NamespacesHandler.cpp     6 May 2002 05:31:57 -0000       1.19
  +++ NamespacesHandler.cpp     24 Jul 2002 23:19:43 -0000      1.20
  @@ -204,7 +204,7 @@
   const XalanDOMString*
   NamespacesHandler::getNamespaceAlias(const XalanDOMString&           
theStylesheetNamespace) const
   {
  -     if (m_namespaceAliases.size() == 0)
  +     if (m_namespaceAliases.empty() == true)
        {
                return 0;
        }
  @@ -394,7 +394,7 @@
                        bool                                                    
supressDefault) const
   {
        // Write out the namespace declarations...
  -     if (m_namespaceDeclarations.size() > 0)
  +     if (m_namespaceDeclarations.empty() == false)
        {
                const NamespacesMapType::const_iterator theEnd =
                                m_namespaceDeclarations.end();
  @@ -519,7 +519,7 @@
        // Go through all of the result namespaces and create the attribute
        // name that will be used when they're written to the result tree.
        // This is more efficient if the stylesheet is used multiple times.
  -     if (m_namespaceDeclarations.size() > 0)
  +     if (m_namespaceDeclarations.empty() == false)
        {
                const NamespacesMapType::iterator       theEnd =
                                m_namespaceDeclarations.end();
  @@ -561,7 +561,7 @@
   void
   NamespacesHandler::processExcludeResultPrefixes(const XalanDOMString&        
theElementPrefix)
   {
  -     if (m_excludedResultPrefixes.size() > 0)
  +     if (m_excludedResultPrefixes.empty() == false)
        {
   #if defined(XALAN_NO_NAMESPACES)
        typedef vector<NamespacesMapType::iterator>             
IteratorVectorType;
  @@ -606,7 +606,7 @@
                        ++i;
                }
   
  -             while(theDeadEntries.size() > 0)
  +             while(theDeadEntries.empty() == false)
                {
                        m_namespaceDeclarations.erase(theDeadEntries.back());
   
  @@ -620,7 +620,7 @@
   void
   NamespacesHandler::processNamespaceAliases()
   {
  -     if (m_processAliases == true && m_namespaceDeclarations.size() > 0)
  +     if (m_processAliases == true && m_namespaceDeclarations.empty() == 
false)
        {
                const NamespacesMapType::iterator       theEnd =
                                m_namespaceDeclarations.end();
  @@ -655,9 +655,9 @@
   void
   NamespacesHandler::copyNamespaceAliases(const NamespaceAliasesMapType&       
theNamespaceAliases)
   {
  -     if (theNamespaceAliases.size() > 0)
  +     if (theNamespaceAliases.empty() == false)
        {
  -             if (m_namespaceAliases.size() == 0)
  +             if (m_namespaceAliases.empty() == true)
                {
                        m_namespaceAliases = theNamespaceAliases;
                }
  @@ -685,9 +685,9 @@
   void
   NamespacesHandler::copyExtensionNamespaceURIs(const 
ExtensionNamespaceURISetType&    theExtensionNamespaceURIs)
   {
  -     if (theExtensionNamespaceURIs.size() > 0)
  +     if (theExtensionNamespaceURIs.empty() == false)
        {
  -             if (m_extensionNamespaceURIs.size() == 0)
  +             if (m_extensionNamespaceURIs.empty() == true)
                {
                        m_extensionNamespaceURIs = theExtensionNamespaceURIs;
                }
  @@ -715,9 +715,9 @@
   void
   NamespacesHandler::copyExcludeResultPrefixes(const 
ExcludedResultPrefixesMapType&    theExcludeResultPrefixes)
   {
  -     if (theExcludeResultPrefixes.size() > 0)
  +     if (theExcludeResultPrefixes.empty() == false)
        {
  -             if (m_excludedResultPrefixes.size() == 0)
  +             if (m_excludedResultPrefixes.empty() == true)
                {
                        m_excludedResultPrefixes = theExcludeResultPrefixes;
                }
  
  
  
  1.25      +7 -7      xml-xalan/c/src/XSLT/NodeSorter.cpp
  
  Index: NodeSorter.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/NodeSorter.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- NodeSorter.cpp    29 May 2002 18:21:52 -0000      1.24
  +++ NodeSorter.cpp    24 Jul 2002 23:19:43 -0000      1.25
  @@ -100,7 +100,7 @@
   void
   NodeSorter::sort(StylesheetExecutionContext& executionContext)
   {
  -     assert(m_scratchVector.size() > 0);
  +     assert(m_scratchVector.empty() == false);
   
        // Make sure the caches are cleared when we're done...
        CollectionClearGuard<NumberResultsCacheType>    
guard1(m_numberResultsCache);
  @@ -131,12 +131,12 @@
                        StylesheetExecutionContext&             
executionContext,
                        MutableNodeRefList&                             theList)
   {
  -     if (m_keys.size() > 0)
  +     if (m_keys.empty() == false)
        {
                const NodeRefListBase::size_type        theLength = 
theList.getLength();
   
                // Copy the nodes to a vector...
  -             assert(m_scratchVector.size() == 0);
  +             assert(m_scratchVector.empty() == true);
   
                // Make sure the scratch vector is cleared when we're done...
                CollectionClearGuard<NodeVectorType>    guard(m_scratchVector);
  @@ -312,7 +312,7 @@
        NumberResultsCacheType&         theCache =
                        m_sorter.m_numberResultsCache;
   
  -     if (theCache.size() == 0)
  +     if (theCache.empty() == true)
        {
                theCache.resize(m_nodeSortKeys.size());
        }
  @@ -324,7 +324,7 @@
        // is just a not-so-random number...
        const double    theDummyValue = 135792468.0L;
   
  -     if (theCache[theKeyIndex].size() != 0)
  +     if (theCache[theKeyIndex].empty() == false)
        {
                if 
(DoubleSupport::equal(theCache[theKeyIndex][theEntry.m_position], 
theDummyValue) == true)
                {
  @@ -377,12 +377,12 @@
        StringResultsCacheType&         theCache =
                        m_sorter.m_stringResultsCache;
   
  -     if (theCache.size() == 0)
  +     if (theCache.empty() == true)
        {
                theCache.resize(m_nodeSortKeys.size());
        }
   
  -     if (theCache[theKeyIndex].size() != 0)
  +     if (theCache[theKeyIndex].empty() == false)
        {
                if (theCache[theKeyIndex][theEntry.m_position].null() == true)
                {
  
  
  
  1.47      +1 -1      xml-xalan/c/src/XSLT/Stylesheet.hpp
  
  Index: Stylesheet.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/Stylesheet.hpp,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- Stylesheet.hpp    27 Jun 2002 15:36:44 -0000      1.46
  +++ Stylesheet.hpp    24 Jul 2002 23:19:43 -0000      1.47
  @@ -465,7 +465,7 @@
        const XalanDOMString&
        getCurrentIncludeBaseIdentifier() const
        {
  -             return m_includeStack.size() == 0 ? getBaseIdentifier() : 
m_includeStack.back();
  +             return m_includeStack.empty() == true ? getBaseIdentifier() : 
m_includeStack.back();
        }
   
        /**
  
  
  
  1.95      +5 -5      
xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp
  
  Index: StylesheetExecutionContextDefault.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XSLT/StylesheetExecutionContextDefault.cpp,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- StylesheetExecutionContextDefault.cpp     10 Jul 2002 06:48:45 -0000      
1.94
  +++ StylesheetExecutionContextDefault.cpp     24 Jul 2002 23:19:43 -0000      
1.95
  @@ -768,7 +768,7 @@
        // We have a params vector that we reuse, but occasionally, a
        // param will result in recursive execution, so we'll use a
        // temporary when we detect such a situation.
  -     if(m_paramsVector.size() == 0)
  +     if(m_paramsVector.empty() == true)
        {
                // This will ensure that the contents of m_paramsVector are
                // cleared.
  @@ -1588,7 +1588,7 @@
   void
   StylesheetExecutionContextDefault::reset()
   {
  -     assert(m_elementRecursionStack.size() == 0);
  +     assert(m_elementRecursionStack.empty() == true);
   
        m_variablesStack.reset();
   
  @@ -2252,7 +2252,7 @@
                        XalanNode*                                      
sourceNode,
                        ParamsVectorType&                       params)
   {
  -     assert(params.size() == 0);
  +     assert(params.empty() == true);
   
        const ElemTemplateElement*      child =
                        xslCallTemplateElement.getFirstChildElem();
  @@ -2369,7 +2369,7 @@
        using std::for_each;
   #endif
   
  -     assert(m_matchPatternCache.size() == 0 || m_xsltProcessor != 0);
  +     assert(m_matchPatternCache.empty() == true || m_xsltProcessor != 0);
   
        if (m_xsltProcessor != 0)
        {
  @@ -2481,5 +2481,5 @@
        // Clear any cached XPaths...
        clearXPathCache();
   
  -     assert(m_matchPatternCache.size() == 0);
  +     assert(m_matchPatternCache.empty() == true);
   }
  
  
  
  1.82      +1 -1      xml-xalan/c/src/XSLT/StylesheetHandler.cpp
  
  Index: StylesheetHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetHandler.cpp,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- StylesheetHandler.cpp     10 Jul 2002 00:41:46 -0000      1.81
  +++ StylesheetHandler.cpp     24 Jul 2002 23:19:43 -0000      1.82
  @@ -1470,7 +1470,7 @@
                        const XalanDOMString    href(atts.getValue(i));
   
                        Stylesheet::URLStackType&       includeStack = 
m_stylesheet.getIncludeStack();
  -                     assert(includeStack.size() > 0);
  +                     assert(includeStack.empty() == false);
   
                        const XalanDOMString    hrefUrl = 
m_constructionContext.getURLStringFromString(href, includeStack.back());
                        assert(length(hrefUrl) != 0);
  
  
  
  1.59      +3 -3      xml-xalan/c/src/XSLT/StylesheetRoot.cpp
  
  Index: StylesheetRoot.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.cpp,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- StylesheetRoot.cpp        20 May 2002 18:12:43 -0000      1.58
  +++ StylesheetRoot.cpp        24 Jul 2002 23:19:43 -0000      1.59
  @@ -168,7 +168,7 @@
   
        // We may need to build keys, since we may have inherited them from
        // our imports.
  -     if (m_needToBuildKeysTable == false && m_keyDeclarations.size() > 0)
  +     if (m_needToBuildKeysTable == false && m_keyDeclarations.empty() == 
false)
        {
                m_needToBuildKeysTable = true;
        }
  @@ -183,7 +183,7 @@
                        m_cdataSectionElems.end(),
                        less<XalanQName>());
   
  -     if (m_cdataSectionElems.size() != 0)
  +     if (m_cdataSectionElems.empty() == false)
        {
                m_hasCdataSectionElems = true;
        }
  @@ -629,7 +629,7 @@
   {
        if(m_needToBuildKeysTable == true)
        {
  -             assert(0 != m_keyDeclarations.size());
  +             assert(m_keyDeclarations.empty() == false);
   
                const KeyTablesTableType::const_iterator        i =
                        theKeysTable.find(doc);
  
  
  
  1.18      +2 -2      xml-xalan/c/src/XSLT/StylesheetRoot.hpp
  
  Index: StylesheetRoot.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/StylesheetRoot.hpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StylesheetRoot.hpp        12 Apr 2002 04:37:48 -0000      1.17
  +++ StylesheetRoot.hpp        24 Jul 2002 23:19:43 -0000      1.18
  @@ -405,8 +405,8 @@
        bool
        hasCDATASectionElements() const
        {
  -             assert(m_hasCdataSectionElems == false && 
m_cdataSectionElems.size() == 0 ||
  -                        m_hasCdataSectionElems == true && 
m_cdataSectionElems.size() != 0);
  +             assert(m_hasCdataSectionElems == false && 
m_cdataSectionElems.empty() == true ||
  +                        m_hasCdataSectionElems == true && 
m_cdataSectionElems.empty() == false);
   
                return m_hasCdataSectionElems;
        }
  
  
  
  1.24      +1 -1      xml-xalan/c/src/XSLT/VariablesStack.cpp
  
  Index: VariablesStack.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/VariablesStack.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- VariablesStack.cpp        27 Feb 2002 03:31:34 -0000      1.23
  +++ VariablesStack.cpp        24 Jul 2002 23:19:43 -0000      1.24
  @@ -92,7 +92,7 @@
   void
   VariablesStack::reset()
   {
  -     while(m_stack.size() > 0)
  +     while(m_stack.empty() == false)
        {
                pop();
        }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to