Prefer prefix ++/-- operators for non-primitive types

+ convert while loop into for loop

To check:
could we use std::find (find_if)?
Is it always ok to do begin()+1?
What about if we return aEnd?

Change-Id: I59107de5693ad7b37e5eef80134c34a03982151e
This commit is contained in:
Julien Nabet
2013-03-30 16:50:47 +01:00
parent 9cc04cb095
commit bd5e62e199

View File

@@ -504,11 +504,11 @@ Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence()
std::vector< OptimizerSettings >::iterator ConfigurationAccess::GetOptimizerSettingsByName( const rtl::OUString& rName ) std::vector< OptimizerSettings >::iterator ConfigurationAccess::GetOptimizerSettingsByName( const rtl::OUString& rName )
{ {
std::vector< OptimizerSettings >::iterator aIter( maSettings.begin() + 1 ); std::vector< OptimizerSettings >::iterator aIter( maSettings.begin() + 1 );
while ( aIter != maSettings.end() ) const std::vector< OptimizerSettings >::const_iterator aEnd( maSettings.end() );
for ( ; aIter != aEnd; ++aIter )
{ {
if ( aIter->maName == rName ) if ( aIter->maName == rName )
break; break;
aIter++;
} }
return aIter; return aIter;
} }