You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@locus.apache.org on 2000/07/02 04:40:53 UTC

cvs commit: xml-xalan/c/src/DOMSupport NamespaceResolver.cpp NamespaceResolver.hpp

dbertoni    00/07/01 19:40:52

  Modified:    c/src/DOMSupport NamespaceResolver.cpp NamespaceResolver.hpp
  Log:
  Added code to reserve space in the candidate vector.
  
  Revision  Changes    Path
  1.10      +4 -2      xml-xalan/c/src/DOMSupport/NamespaceResolver.cpp
  
  Index: NamespaceResolver.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/DOMSupport/NamespaceResolver.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- NamespaceResolver.cpp	2000/06/29 20:28:24	1.9
  +++ NamespaceResolver.cpp	2000/07/02 02:40:50	1.10
  @@ -218,6 +218,8 @@
   
   			CandidateNoAncestorVectorType	candidateNoAncestorXMLNS;
   
  +			candidateNoAncestorXMLNS.reserve(eDefaultVectorSize);
  +
   			// Hunt upward until resolve namespace or fail to do so.
   			while (0 != parent && length(namespaceOfPrefix) == 0)
   			{
  @@ -333,7 +335,7 @@
   			}
   
   			// Anotation pass over the "any other node" queue
  -			const int	nCandidates = candidateNoAncestorXMLNS.size();
  +			const unsigned int	nCandidates = candidateNoAncestorXMLNS.size();
   
   			if(nCandidates > 0)
   			{
  @@ -343,7 +345,7 @@
   				// ????? This feels overcomplicated, somehow... 
   				if(false == ancestorsHaveXMLNS && 0 == parent)
   				{
  -					for(int i = 0; i < nCandidates; i++)
  +					for(unsigned int i = 0; i < nCandidates; i++)
   					{
   						const NSInfo&	candidateInfo = candidateNoAncestorXMLNS[i].second;
   
  
  
  
  1.6       +8 -0      xml-xalan/c/src/DOMSupport/NamespaceResolver.hpp
  
  Index: NamespaceResolver.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/DOMSupport/NamespaceResolver.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NamespaceResolver.hpp	2000/04/11 14:30:44	1.5
  +++ NamespaceResolver.hpp	2000/07/02 02:40:50	1.6
  @@ -120,6 +120,14 @@
   			const XalanNode*	theNode,
   			const NSInfo&		theNamespace) const;
   
  +protected:
  +
  +	// Default vector allocation size.
  +	enum
  +	{
  +		eDefaultVectorSize = 10
  +	};
  +
   	// Cached namespace information...
   	mutable NSInfoMapType	m_NSInfos;
   };