[Libreoffice-commits] online.git: net/Socket.hpp

Miklos Vajna vmiklos at collabora.co.uk
Thu May 24 06:50:48 UTC 2018


 net/Socket.hpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 65df3e6ceb8bf06f8ed2afd9f3667a1458ceeec8
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu May 24 08:50:22 2018 +0200

    net: use std::move() in the StreamSocket ctor
    
    It was inconsistent that the StreamSocket ctor had a const parameter,
    but the SslStreamSocket had a non-const one and used std::move(). Use
    the later in the parent class as well for consistency.
    
    Change-Id: I58597b97432a801d164d6ed9d831a0372280e687

diff --git a/net/Socket.hpp b/net/Socket.hpp
index 6cd2190d4..965f08247 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -706,9 +706,9 @@ class StreamSocket : public Socket, public std::enable_shared_from_this<StreamSo
 public:
     /// Create a StreamSocket from native FD.
     StreamSocket(const int fd, bool /* isClient */,
-                 const std::shared_ptr<SocketHandlerInterface> socketHandler) :
+                 std::shared_ptr<SocketHandlerInterface> socketHandler) :
         Socket(fd),
-        _socketHandler(socketHandler),
+        _socketHandler(std::move(socketHandler)),
         _bytesSent(0),
         _bytesRecvd(0),
         _wsState(WSState::HTTP),


More information about the Libreoffice-commits mailing list