]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add move semantics to Security::ServerOptions and Security::PeerOptions
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 11 Mar 2017 16:33:07 +0000 (05:33 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 11 Mar 2017 16:33:07 +0000 (05:33 +1300)
This apparently will make the clear() operators faster as they no longer
have to data-copy.

  Detected by Coverity Scan. Issues 1364734 and 1364737

src/security/PeerOptions.h
src/security/ServerOptions.h

index cbe848ecd6d87a5f343104e532122a47b0549e54..72cf2904d15fa0c6a34680e041f6c57c2f6be0a0 100644 (file)
@@ -25,6 +25,8 @@ public:
     PeerOptions();
     PeerOptions(const PeerOptions &) = default;
     PeerOptions &operator =(const PeerOptions &) = default;
+    PeerOptions(PeerOptions &&) = default;
+    PeerOptions &operator =(PeerOptions &&) = default;
     virtual ~PeerOptions() {}
 
     /// parse a TLS squid.conf option
index cb79f47f7a429920bffb32e661f6cf1436cad768..6072d9739908e36d24e298be0c04b75447cefa65 100644 (file)
@@ -24,6 +24,10 @@ public:
         // is more secure to have only a small set of trusted CA.
         flags.tlsDefaultCa.defaultTo(false);
     }
+    ServerOptions(const ServerOptions &) = default;
+    ServerOptions &operator =(const ServerOptions &) = default;
+    ServerOptions(ServerOptions &&) = default;
+    ServerOptions &operator =(ServerOptions &&) = default;
     virtual ~ServerOptions() = default;
 
     /* Security::PeerOptions API */