ucbhelper/source/client/proxydecider.cxx |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 183dd9deec869209c45378ff09f063cc9bf03e26
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Apr 29 09:22:20 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Apr 29 13:00:29 2022 +0200

    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.gran...@collabora.co.uk>

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 );

Reply via email to