diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-03-09 15:54:13 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-09 18:31:12 +0100 |
commit | 31f96c3e0d13180447c45212158ee69e791c645a (patch) | |
tree | 3ec7744b25a3929cafd4bbdffd018a5036055ad7 /connectivity/source/manager/mdrivermanager.cxx | |
parent | 4e25914b165d7ed64b3026af758fb857676aacd5 (diff) |
Simplify containers iterations in connectivity
Use range-based loop or replace with STL functions
Change-Id: I1f7c1ea19cdc8d450b7ed88a663ba9ccb3249304
Reviewed-on: https://gerrit.libreoffice.org/68974
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/manager/mdrivermanager.cxx')
-rw-r--r-- | connectivity/source/manager/mdrivermanager.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx index b1824d338efb..2a1a31f9d575 100644 --- a/connectivity/source/manager/mdrivermanager.cxx +++ b/connectivity/source/manager/mdrivermanager.cxx @@ -349,18 +349,18 @@ void OSDBCDriverManager::initializeDriverPrecedence() // sort our bootstrapped drivers std::sort( m_aDriversBS.begin(), m_aDriversBS.end(), CompareDriverAccessByName() ); - // loop through the names in the precedence order - const OUString* pDriverOrder = aDriverOrder.getConstArray(); - const OUString* pDriverOrderEnd = pDriverOrder + aDriverOrder.getLength(); - // the first driver for which there is no preference DriverAccessArray::iterator aNoPrefDriversStart = m_aDriversBS.begin(); // at the moment this is the first of all drivers we know - for ( ; ( pDriverOrder < pDriverOrderEnd ) && ( aNoPrefDriversStart != m_aDriversBS.end() ); ++pDriverOrder ) + // loop through the names in the precedence order + for ( const OUString& rDriverOrder : aDriverOrder ) { + if (aNoPrefDriversStart == m_aDriversBS.end()) + break; + DriverAccess driver_order; - driver_order.sImplementationName = *pDriverOrder; + driver_order.sImplementationName = rDriverOrder; // look for the impl name in the DriverAccess array std::pair< DriverAccessArray::iterator, DriverAccessArray::iterator > aPos = |