dbertoni    2003/05/14 09:24:18

  Modified:    c/src/PlatformSupport XalanArrayAllocator.hpp
  Log:
  Check for empty list before iterating it.
  
  Revision  Changes    Path
  1.9       +15 -8     xml-xalan/c/src/PlatformSupport/XalanArrayAllocator.hpp
  
  Index: XalanArrayAllocator.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/XalanArrayAllocator.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XalanArrayAllocator.hpp   20 Nov 2002 02:27:13 -0000      1.8
  +++ XalanArrayAllocator.hpp   14 May 2003 16:24:17 -0000      1.9
  @@ -133,17 +133,24 @@
        void
        reset()
        {
  -             const ListIteratorType  theEnd = m_list.end();
  -             ListIteratorType                theCurrent = m_list.begin();
  -
  -             while(theCurrent != theEnd)
  +             if (m_list.empty() == true)
                {
  -                     (*theCurrent).first = (*theCurrent).second.size();
  -
  -                     ++theCurrent;
  +                     m_lastEntryFound = 0;
                }
  +             else
  +             {
  +                     const ListIteratorType  theEnd = m_list.end();
  +                     ListIteratorType                theCurrent = 
m_list.begin();
   
  -             m_lastEntryFound = &*m_list.begin();
  +                     do
  +                     {
  +                             (*theCurrent).first = 
(*theCurrent).second.size();
  +
  +                             ++theCurrent;
  +                     } while(theCurrent != theEnd);
  +
  +                     m_lastEntryFound = &*m_list.begin();
  +             }
        }
   
        /**
  
  
  

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

Reply via email to