[Plib-cvs] CVS: plib/src/util ul.h,1.38,1.39 ulLinkedList.cxx,1.3,1.4
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-03-24 19:42:57
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv2089 Modified Files: ul.h ulLinkedList.cxx Log Message: Changed ulLinkedList::forEach () to return the data of the node where the iteration stopped Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- ul.h 21 Mar 2002 15:41:47 -0000 1.38 +++ ul.h 24 Mar 2002 19:42:54 -0000 1.39 @@ -724,7 +724,7 @@ void * getNodeData ( int pos ) const ; - void forEach ( ulIterateFunc fn ) const ; + void * forEach ( ulIterateFunc fn ) const ; void empty ( ulIterateFunc destroyfn = NULL ) ; } ; Index: ulLinkedList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulLinkedList.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ulLinkedList.cxx 21 Mar 2002 19:26:01 -0000 1.3 +++ ulLinkedList.cxx 24 Mar 2002 19:42:54 -0000 1.4 @@ -240,15 +240,17 @@ } -void ulLinkedList::forEach ( ulIterateFunc fn ) const +void * ulLinkedList::forEach ( ulIterateFunc fn ) const { ulListNode *curr ; for ( curr = head ; curr != NULL ; curr = curr -> getNext () ) { if ( (*fn)( curr -> getData () ) == false ) - break ; + return curr -> getData () ; } + + return NULL ; } |