diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-08-15 21:32:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-20 17:12:11 +0200 |
commit | 0787ce8814e37972a0c968f60008d4e8722b6e27 (patch) | |
tree | 9d2803ebda8813e6b3f2bc2e6f8a74953b2931c1 /stoc | |
parent | d2c9c60fefb9687adbde4be61ed66a5123a2587f (diff) |
Simplify containers iterations, tdf#96099 follow-up
Use range-based loop or replace with std::any_of, std::find and
std::find_if where applicable.
Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6
Reviewed-on: https://gerrit.libreoffice.org/59143
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 3 | ||||
-rw-r--r-- | stoc/source/uriproc/UriReferenceFactory.cxx | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index a954372b6728..68db4a793265 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -1399,9 +1399,8 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset) getINetPropsFromConfig( &jvm, m_xContext->getServiceManager(), m_xContext); const ::std::vector< OUString> & Props = jvm.getProperties(); - for( auto i= Props.cbegin(); i != Props.cend(); ++i) + for( auto& prop : Props) { - OUString prop= *i; sal_Int32 index= prop.indexOf( '='); OUString propName= prop.copy( 0, index); OUString propValue= prop.copy( index + 1); diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx index 600df5e7cde2..402da59393f3 100644 --- a/stoc/source/uriproc/UriReferenceFactory.cxx +++ b/stoc/source/uriproc/UriReferenceFactory.cxx @@ -418,11 +418,11 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( if (slash) { abs.append('/'); } - for (auto i(segments.begin()); i != segments.end(); ++i) + for (auto& i : segments) { - if (*i < -1) { + if (i < -1) { OUString segment( - baseUriReference->getPathSegment(-(*i + 2))); + baseUriReference->getPathSegment(-(i + 2))); if (!segment.isEmpty() || segments.size() > 1) { if (!slash) { abs.append('/'); @@ -431,8 +431,8 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( slash = true; abs.append('/'); } - } else if (*i > 1) { - OUString segment(uriReference->getPathSegment(*i - 2)); + } else if (i > 1) { + OUString segment(uriReference->getPathSegment(i - 2)); if (!segment.isEmpty() || segments.size() > 1) { if (!slash) { abs.append('/'); @@ -440,7 +440,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( abs.append(segment); slash = false; } - } else if (*i == 0) { + } else if (i == 0) { if (segments.size() > 1 && !slash) { abs.append('/'); } @@ -454,7 +454,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( abs.append('/'); } abs.append(".."); - slash = *i < 0; + slash = i < 0; if (slash) { abs.append('/'); } |