From 3f08be2e511dc2300021486a1cc2f1e8ba530373 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Tue, 12 Feb 2019 00:00:22 +0300 Subject: Simplify containers iterations in reportdesign, sal, sax Use range-based loop or replace with STL functions Change-Id: If6b734dab12a7298fce16003d3d175305fbe798d Reviewed-on: https://gerrit.libreoffice.org/67701 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sal/rtl/bootstrap.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sal/rtl') diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 3482017958c0..4a913f5fef3a 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -133,13 +133,12 @@ static bool find( OUString * value) { OSL_ASSERT(value); - for (NameValueVector::const_iterator i(vector.begin()); i != vector.end(); ++i) + auto i = std::find_if(vector.begin(), vector.end(), + [&key](const rtl_bootstrap_NameValue& rNameValue) { return rNameValue.sName == key; }); + if (i != vector.end()) { - if (i->sName == key) - { - *value = i->sValue; - return true; - } + *value = i->sValue; + return true; } return false; } -- cgit