diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-06 12:27:44 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-06 13:54:29 +0200 |
commit | 4435135e68f7d1024875defc3df18de183607048 (patch) | |
tree | 986a7adf4e9631826a3440abf3e4f2a7857906c9 /scripting | |
parent | 97dac306e6b4c26f67307e6b3bb0c2b2b470a09a (diff) |
Use range-based loop
Change-Id: I5c1233f53ca5c9f4322ecf7a832880399d6fec5e
Reviewed-on: https://gerrit.libreoffice.org/61463
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/provider/ProviderCache.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index 4e3b0230efa9..eeaac5fd44eb 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -88,16 +88,13 @@ ProviderCache::getAllProviders() ::osl::Guard< osl::Mutex > aGuard( m_mutex ); Sequence < Reference< provider::XScriptProvider > > providers ( m_hProviderDetailsCache.size() ); - ProviderDetails_hash::iterator h_itEnd = m_hProviderDetailsCache.end(); - ProviderDetails_hash::iterator h_it = m_hProviderDetailsCache.begin(); // should assert if size !> 0 if ( !m_hProviderDetailsCache.empty() ) { sal_Int32 providerIndex = 0; - sal_Int32 index = 0; - for ( index = 0; h_it != h_itEnd; ++h_it, index++ ) + for (auto& rDetail : m_hProviderDetailsCache) { - Reference< provider::XScriptProvider > xScriptProvider = h_it->second.provider; + Reference<provider::XScriptProvider> xScriptProvider = rDetail.second.provider; if ( xScriptProvider.is() ) { providers[ providerIndex++ ] = xScriptProvider; @@ -107,7 +104,7 @@ ProviderCache::getAllProviders() // create provider try { - xScriptProvider = createProvider( h_it->second ); + xScriptProvider = createProvider(rDetail.second); providers[ providerIndex++ ] = xScriptProvider; } catch ( const Exception& ) @@ -117,7 +114,7 @@ ProviderCache::getAllProviders() } } - if ( providerIndex < index ) + if (providerIndex < providers.getLength()) { providers.realloc( providerIndex ); } |