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 2003/05/14 18:24:19 UTC
cvs commit: xml-xalan/c/src/PlatformSupport XalanArrayAllocator.hpp
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: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org