dbertoni    2002/10/04 01:30:31

  Modified:    c/src/XSLT XSLTEngineImpl.cpp XSLTEngineImpl.hpp
  Log:
  Use vector instead of set for storing attribute names already visited.
  
  Revision  Changes    Path
  1.160     +9 -3      xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp
  
  Index: XSLTEngineImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.cpp,v
  retrieving revision 1.159
  retrieving revision 1.160
  diff -u -r1.159 -r1.160
  --- XSLTEngineImpl.cpp        27 Sep 2002 23:31:38 -0000      1.159
  +++ XSLTEngineImpl.cpp        4 Oct 2002 08:30:30 -0000       1.160
  @@ -195,7 +195,6 @@
        m_dummyAttributesList(),
        m_scratchString(),
        m_attributeNamesVisited(),
  -     m_attributeNamesVisitedEnd(m_attributeNamesVisited.end()),
        m_hasStripOrPreserveSpace(false),
        m_hasCDATASectionElements(false)
   {
  @@ -2941,11 +2940,18 @@
   
                        const XalanDOMString&   nodeName = attr->getNodeName();
   
  -                     if (m_attributeNamesVisited.find(&nodeName) == 
m_attributeNamesVisitedEnd)
  +#if !defined(XALAN_NO_NAMESPACES)
  +                     using std::find_if;
  +#endif
  +
  +                     if (find_if(
  +                                     m_attributeNamesVisited.begin(),
  +                                     m_attributeNamesVisited.end(),
  +                                     FindStringPointerFunctor(nodeName)) == 
m_attributeNamesVisited.end())
                        {
                                addResultNamespace(*attr, thePendingAttributes, true);
   
  -                             m_attributeNamesVisited.insert(&nodeName);
  +                             m_attributeNamesVisited.push_back(&nodeName);
                        }
                }
   
  
  
  
  1.97      +27 -11    xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp
  
  Index: XSLTEngineImpl.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTEngineImpl.hpp,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- XSLTEngineImpl.hpp        27 Sep 2002 23:31:38 -0000      1.96
  +++ XSLTEngineImpl.hpp        4 Oct 2002 08:30:31 -0000       1.97
  @@ -187,17 +187,35 @@
        typedef vector<const Locator*>                  LocatorStack;
        typedef vector<TraceListener*>                  TraceListenerVectorType;
        typedef vector<bool>                                    BoolVectorType;
  -     typedef set<const XalanDOMString*,
  -                             LessXalanDOMStringPointers>     
XalanDOMStringPointerSetType;
  +     typedef vector<const XalanDOMString*>   XalanDOMStringPointerVectorType;
   #else
        typedef std::map<const void*, ClockType>        DurationsTableMapType;
        typedef std::vector<const Locator*>                     LocatorStack;
        typedef std::vector<TraceListener*>                     
TraceListenerVectorType;
        typedef std::vector<bool>                                       BoolVectorType;
  -     typedef std::set<const XalanDOMString*,
  -                                      LessXalanDOMStringPointers>    
XalanDOMStringPointerSetType;
  +     typedef std::vector<const XalanDOMString*>      
XalanDOMStringPointerVectorType;
   #endif
   
  +     struct FindStringPointerFunctor
  +     {
  +             FindStringPointerFunctor(const XalanDOMString&  theString) :
  +                     m_string(theString)
  +             {
  +             }
  +
  +             bool
  +             operator()(const XalanDOMString*        theString) const
  +             {
  +                     assert(theString != 0);
  +
  +                     return *theString == m_string;
  +             }
  +
  +     private:
  +
  +             const XalanDOMString&   m_string;
  +     };
  +
        typedef XalanAutoPtr<XPathProcessor>                            
XPathProcessorPtrType;
        typedef Function::XObjectArgVectorType                          
XObjectArgVectorType;
        typedef StylesheetExecutionContext::ParamVectorType     ParamVectorType;
  @@ -1708,17 +1726,15 @@
        /*
         * Dummy AttributeListImpl
         */
  -     AttributeListImpl                               m_dummyAttributesList;
  -
  -     XalanDOMString                                  m_scratchString;
  +     AttributeListImpl                                       m_dummyAttributesList;
   
  -     XalanDOMStringPointerSetType    m_attributeNamesVisited;
  +     XalanDOMString                                          m_scratchString;
   
  -     const XalanDOMStringPointerSetType::iterator    m_attributeNamesVisitedEnd;
  +     XalanDOMStringPointerVectorType         m_attributeNamesVisited;
   
  -     bool                                                    
m_hasStripOrPreserveSpace;
  +     bool                                                            
m_hasStripOrPreserveSpace;
   
  -     bool                                                    
m_hasCDATASectionElements;
  +     bool                                                            
m_hasCDATASectionElements;
   
        static void
        installFunctions();
  
  
  

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

Reply via email to