summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-02 22:46:22 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-03 07:14:22 +0100
commitb80403167935550a4dd97f31b79d2bdcb97e4e88 (patch)
tree4cb7098e5ff3300f72b3675239d9e794dbac36fe /ucbhelper
parent42bfbc216474b4f60d5a5e52a88d95baded5191c (diff)
Replace lists by vector or deque in ucb/ucbhelper
Change-Id: I9f72d7c8ab48f8dc2eec779db2f40531a33db6f9 Reviewed-on: https://gerrit.libreoffice.org/44238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/client/proxydecider.cxx28
1 files changed, 8 insertions, 20 deletions
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx
index 2109f439c0df..cc0dd60afeab 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -19,7 +19,7 @@
#include <utility>
#include <vector>
-#include <list>
+#include <deque>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
@@ -78,7 +78,7 @@ class HostnameCache
{
typedef std::pair< OUString, OUString > HostListEntry;
- std::list< HostListEntry > m_aHostList;
+ std::deque< HostListEntry > m_aHostList;
sal_uInt32 m_nCapacity;
public:
@@ -87,19 +87,13 @@ public:
bool get( const OUString & rKey, OUString & rValue ) const
{
- std::list< HostListEntry >::const_iterator it
- = m_aHostList.begin();
- const std::list< HostListEntry >::const_iterator end
- = m_aHostList.end();
-
- while ( it != end )
+ for (auto const& host : m_aHostList)
{
- if ( (*it).first == rKey )
+ if ( host.first == rKey )
{
- rValue = (*it).second;
+ rValue = host.second;
return true;
}
- ++it;
}
return false;
}
@@ -417,24 +411,18 @@ bool InternetProxyDecider_Impl::shouldUseProxy( const OUString & rHost,
aBuffer.append( OUString::number( nPort ) );
const OUString aHostAndPort( aBuffer.makeStringAndClear() );
- std::vector< NoProxyListEntry >::const_iterator it
- = m_aNoProxyList.begin();
- const std::vector< NoProxyListEntry >::const_iterator end
- = m_aNoProxyList.end();
-
- while ( it != end )
+ for (auto const& noProxy : m_aNoProxyList)
{
if ( bUseFullyQualified )
{
- if ( (*it).second.Matches( aHostAndPort ) )
+ if ( noProxy.second.Matches( aHostAndPort ) )
return false;
}
else
{
- if ( (*it).first.Matches( aHostAndPort ) )
+ if ( noProxy.first.Matches( aHostAndPort ) )
return false;
}
- ++it;
}
return true;