sd/source/ui/remotecontrol/Server.cxx |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit d6078e02832d13054e6552c6e20277fd1f3e83f6
Author:     Andrzej Hunt <andr...@ahunt.org>
AuthorDate: Fri Jul 16 18:55:19 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jul 17 11:49:20 2021 +0200

    sdremote: clean up now-unneeded "found" flag
    
    Since ???, this code now lives in a standalone method, allowing
    us to return as soon as know that the handshake is complete. This
    lets us remove aFound and simplify the code a little.
    
    Change-Id: I51d5281492d2e4280a101e67d606073f4d064c29
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119084
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/remotecontrol/Server.cxx 
b/sd/source/ui/remotecontrol/Server.cxx
index 6a1716b22e86..e3576bacd52e 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -149,7 +149,6 @@ void RemoteServer::handleAcceptedConnection( 
BufferedStreamSocket *pSocket )
         // Check if we already have this server.
         Reference< XNameAccess > const xConfig = 
officecfg::Office::Impress::Misc::AuthorisedRemotes::get();
         const Sequence< OUString > aNames = xConfig->getElementNames();
-        bool aFound = false;
         for ( const auto& rName : aNames )
         {
             if ( rName == pClient->mName )
@@ -162,18 +161,14 @@ void RemoteServer::handleAcceptedConnection( 
BufferedStreamSocket *pSocket )
                 if ( sPin == pClient->mPin ) {
                     SAL_INFO( "sdremote", "client found on validated list -- 
connecting" );
                     connectClient( pClient, sPin );
-                    aFound = true;
-                    break;
+                    return;
                 }
             }
         }
         // Pin not found so inform the client.
-        if ( !aFound )
-        {
-            SAL_INFO( "sdremote", "client not found on validated list" );
-            pSocket->write( "LO_SERVER_VALIDATING_PIN\n\n",
+        SAL_INFO( "sdremote", "client not found on validated list" );
+        pSocket->write( "LO_SERVER_VALIDATING_PIN\n\n",
                         strlen( "LO_SERVER_VALIDATING_PIN\n\n" ) );
-        }
     } else {
         SAL_INFO( "sdremote", "client failed to send LO_SERVER_CLIENT_PAIR, 
ignoring" );
         delete pSocket;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to