From b38e690296e48657ec8c66427a6511f42f4b0115 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Wed, 19 Dec 2018 21:53:06 +0300 Subject: Simplify containers iterations in scaddins, sccomp, scripting Use range-based loop or replace with STL functions Change-Id: I21ec2eea8f322e2792097d352fc352dc6099c7b7 Reviewed-on: https://gerrit.libreoffice.org/65461 Tested-by: Jenkins Reviewed-by: Noel Grandin --- scaddins/source/analysis/analysishelper.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scaddins') diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 1a21ecbb0b31..787c99bd3dd8 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -2457,10 +2457,9 @@ double ConvertDataList::Convert( double fVal, const OUString& rFrom, const OUStr sal_Int16 nLevelFrom = 0; sal_Int16 nLevelTo = 0; - auto it = maVector.begin(); - while( it != maVector.end() && ( bSearchFrom || bSearchTo ) ) + for( const auto& rItem : maVector ) { - ConvertData* p = it->get(); + ConvertData* p = rItem.get(); if( bSearchFrom ) { sal_Int16 n = p->GetMatchingLevel( rFrom ); @@ -2499,7 +2498,8 @@ double ConvertDataList::Convert( double fVal, const OUString& rFrom, const OUStr } } - ++it; + if( !bSearchFrom && !bSearchTo ) + break; } if( !pFrom || !pTo ) -- cgit