[Libreoffice-commits] core.git: sdext/source

Julien Nabet serval2412 at yahoo.fr
Sat Mar 30 08:55:00 PDT 2013


 sdext/source/minimizer/configurationaccess.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bd5e62e199f30724b59f7261bd65add6375a1e16
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Mar 30 16:50:47 2013 +0100

    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

diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx
index c9ebbd6..2a34217 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -504,11 +504,11 @@ Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence()
 std::vector< OptimizerSettings >::iterator ConfigurationAccess::GetOptimizerSettingsByName( const rtl::OUString& rName )
 {
     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 )
             break;
-        aIter++;
     }
     return aIter;
 }


More information about the Libreoffice-commits mailing list