From 6e886d2f1ec0a52a32858e7aa374f031506573d7 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Tue, 11 Mar 2003 19:44:17 +0000 Subject: switched to an implementation using index instead of iterator to avoid usage of typename --- include/cppunit/tools/Algorithm.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include/cppunit') diff --git a/include/cppunit/tools/Algorithm.h b/include/cppunit/tools/Algorithm.h index 1d10ca5..143e5d6 100644 --- a/include/cppunit/tools/Algorithm.h +++ b/include/cppunit/tools/Algorithm.h @@ -10,14 +10,10 @@ void removeFromSequence( SequenceType &sequence, const ValueType &valueToRemove ) { - SequenceType::iterator it = sequence.begin(); - SequenceType::iterator itEnd = sequence.end(); - while ( it != itEnd ) + for ( int index =0; index < sequence.size(); ++index ) { - if ( *it == valueToRemove ) - it = sequence.erase( it ); - else - ++it; + if ( sequence[ index ] == valueToRemove ) + sequence.erase( sequence.begin() + index ); } } -- cgit v1.2.1