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...@apache.org on 2004/02/06 02:43:08 UTC

cvs commit: xml-xalan/c/src/xalanc/XPath XPathFactoryDefault.cpp

dbertoni    2004/02/05 17:43:08

  Modified:    c/src/xalanc/XPath XPathFactoryDefault.cpp
  Log:
  Better logic to find and/or erase the XPath object instance.
  
  Revision  Changes    Path
  1.4       +8 -12     xml-xalan/c/src/xalanc/XPath/XPathFactoryDefault.cpp
  
  Index: XPathFactoryDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XPath/XPathFactoryDefault.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XPathFactoryDefault.cpp	6 Jan 2004 02:41:32 -0000	1.3
  +++ XPathFactoryDefault.cpp	6 Feb 2004 01:43:08 -0000	1.4
  @@ -105,15 +105,15 @@
   			const XPath*	theXPath,
   			bool			fInReset)
   {
  -	const CollectionType::iterator	i =
  -		m_xpaths.find(theXPath);
  +    const CollectionType::size_type     theCount =
  +        fInReset == true ? m_xpaths.count(theXPath) : m_xpaths.erase(theXPath);
   
  -	if (i != m_xpaths.end())
  -	{
  -		if (fInReset == false)
  -		{
  -			m_xpaths.erase(i);
  -		}
  +    if (theCount == 0)
  +    {
  +        return false;
  +    }
  +    else
  +    {
   
   #if defined(XALAN_CANNOT_DELETE_CONST)
   		delete (XPath*)theXPath;
  @@ -122,10 +122,6 @@
   #endif
   
   		return true;
  -	}
  -	else
  -	{
  -		return false;
   	}
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org