diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 09:22:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-29 13:00:29 +0200 |
commit | 183dd9deec869209c45378ff09f063cc9bf03e26 (patch) | |
tree | 414718e4170d08d36fee392cd72cbcc27920eb04 /ucbhelper | |
parent | 38d4b6eb42246c0dbd4958a50ed8437bc93508d6 (diff) |
Revert "use more string_view in ucbhelper"
This reverts commit d9c3f05dcb6c03633bbcc8d88e55237a0855d9a5.
This is likely a pessimisation since the
OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos );
was previously likely mostly just copying the whole string in which case it would return the same object.
Change-Id: I1e09630f0095d194deb72f70bba2d65c04771487
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133491
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/client/proxydecider.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index cf10fda8baa3..10228b72aedc 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -157,7 +157,7 @@ public: virtual void SAL_CALL disposing( const lang::EventObject& Source ) override; private: - void setNoProxyList( std::u16string_view rNoProxyList ); + void setNoProxyList( const OUString & rNoProxyList ); }; @@ -809,28 +809,29 @@ void SAL_CALL InternetProxyDecider_Impl::disposing(const lang::EventObject&) } -void InternetProxyDecider_Impl::setNoProxyList( std::u16string_view rNoProxyList ) +void InternetProxyDecider_Impl::setNoProxyList( + const OUString & rNoProxyList ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); m_aNoProxyList.clear(); - if ( rNoProxyList.empty() ) + if ( rNoProxyList.isEmpty() ) return; // List of connection endpoints hostname[:port], // separated by semicolon. Wildcards allowed. - size_t nPos = 0; - size_t nEnd = rNoProxyList.find( ';' ); - size_t nLen = rNoProxyList.size(); + sal_Int32 nPos = 0; + sal_Int32 nEnd = rNoProxyList.indexOf( ';' ); + sal_Int32 nLen = rNoProxyList.getLength(); do { - if ( nEnd == std::u16string_view::npos ) + if ( nEnd == -1 ) nEnd = nLen; - OUString aToken( rNoProxyList.substr( nPos, nEnd - nPos ) ); + OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos ); if ( !aToken.isEmpty() ) { @@ -909,7 +910,7 @@ void InternetProxyDecider_Impl::setNoProxyList( std::u16string_view rNoProxyList if ( nEnd != nLen ) { nPos = nEnd + 1; - nEnd = rNoProxyList.find( ';', nPos ); + nEnd = rNoProxyList.indexOf( ';', nPos ); } } while ( nEnd != nLen ); |