summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-02-12 00:00:22 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-12 07:37:08 +0100
commit3f08be2e511dc2300021486a1cc2f1e8ba530373 (patch)
tree4498ff04e82aa36b94274af254b60f35e29805a8 /sal
parentf9c57cae202818258b416b4ca28040a44e8887c2 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/bootstrap.cxx11
1 files changed, 5 insertions, 6 deletions
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;
}