From 9d7620613d3ea2feb45a7ff57c4d2544bb1c6fe6 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Fri, 15 Feb 2019 00:08:43 +0300 Subject: Simplify containers iterations in oox, opencl, package Use range-based loop or replace with STL functions Change-Id: I91405920d91383bc6cf13b9497d262b1f6f0a84d Reviewed-on: https://gerrit.libreoffice.org/67848 Tested-by: Jenkins Reviewed-by: Noel Grandin --- opencl/source/openclconfig.cxx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'opencl/source') diff --git a/opencl/source/openclconfig.cxx b/opencl/source/openclconfig.cxx index cf067de5aac3..6fcd59618789 100644 --- a/opencl/source/openclconfig.cxx +++ b/opencl/source/openclconfig.cxx @@ -58,14 +58,14 @@ css::uno::Sequence SetOfImplMatcherToStringSequence(const OpenCLConfig css::uno::Sequence result(rSet.size()); size_t n(0); - for (auto i = rSet.cbegin(); i != rSet.cend(); ++i) + for (const auto& rItem : rSet) { result[n++] = - (*i).maOS.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + - (*i).maOSVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + - (*i).maPlatformVendor.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + - (*i).maDevice.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + - (*i).maDriverVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B"); + rItem.maOS.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + + rItem.maOSVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + + rItem.maPlatformVendor.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + + rItem.maDevice.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B") + "/" + + rItem.maDriverVersion.replaceAll("%", "%25").replaceAll("/", "%2F").replaceAll(";", "%3B"); } return result; @@ -100,15 +100,15 @@ OpenCLConfig::ImplMatcherSet StringSequenceToSetOfImplMatcher(const css::uno::Se { OpenCLConfig::ImplMatcherSet result; - for (auto i = rSequence.begin(); i != rSequence.end(); ++i) + for (const auto& rItem : rSequence) { OpenCLConfig::ImplMatcher m; sal_Int32 index(0); - m.maOS = getToken(*i, index); - m.maOSVersion = getToken(*i, index); - m.maPlatformVendor = getToken(*i, index); - m.maDevice = getToken(*i, index); - m.maDriverVersion = getToken(*i, index); + m.maOS = getToken(rItem, index); + m.maOSVersion = getToken(rItem, index); + m.maPlatformVendor = getToken(rItem, index); + m.maDevice = getToken(rItem, index); + m.maDriverVersion = getToken(rItem, index); result.insert(m); } @@ -158,12 +158,12 @@ bool match(const OpenCLConfig::ImplMatcher& rListEntry, const OpenCLPlatformInfo bool match(const OpenCLConfig::ImplMatcherSet& rList, const OpenCLPlatformInfo& rPlatform, const OpenCLDeviceInfo& rDevice, const char* sKindOfList) { - for (auto i = rList.cbegin(); i != rList.end(); ++i) + for (const auto& rListEntry : rList) { SAL_INFO("opencl", "Looking for match for platform=" << rPlatform << ", device=" << rDevice << - " in " << sKindOfList << " entry=" << *i); + " in " << sKindOfList << " entry=" << rListEntry); - if (match(*i, rPlatform, rDevice)) + if (match(rListEntry, rPlatform, rDevice)) { SAL_INFO("opencl", "Match!"); return true; -- cgit