Use default member init for PKeyCtx::_ctx and PKey::_pkey
authorStephan Beyer <s-beyer@gmx.net>
Tue, 7 Jul 2020 07:31:01 +0000 (09:31 +0200)
committerKevin Ottens <ervin@ipsquad.net>
Wed, 8 Jul 2020 12:08:41 +0000 (14:08 +0200)
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
src/libsync/clientsideencryption.cpp

index 78874a92cb29a8fd68d4ca8ed8b85ad24c02fcaa..c7cf7a5bd3d41f60c29bf2df408d30a1014d46a6 100644 (file)
@@ -137,7 +137,6 @@ namespace {
         // and we have a `forKey` static function that returns
         // an instance of this class
         PKeyCtx(PKeyCtx&& other)
-            : _ctx(nullptr)
         {
             std::swap(_ctx, other._ctx);
         }
@@ -159,12 +158,9 @@ namespace {
     private:
         Q_DISABLE_COPY(PKeyCtx)
 
-        PKeyCtx()
-            : _ctx(nullptr)
-        {
-        }
+        PKeyCtx() = default;
 
-        EVP_PKEY_CTX* _ctx;
+        EVP_PKEY_CTX* _ctx = nullptr;
     };
 
     class PKey {
@@ -179,7 +175,6 @@ namespace {
         // and we have a static functions that return
         // an instance of this class
         PKey(PKey&& other)
-            : _pkey(nullptr)
         {
             std::swap(_pkey, other._pkey);
         }
@@ -217,17 +212,11 @@ namespace {
     private:
         Q_DISABLE_COPY(PKey)
 
-        PKey()
-            : _pkey(nullptr)
-        {
-        }
+        PKey() = default;
 
-        EVP_PKEY* _pkey;
+        EVP_PKEY* _pkey = nullptr;
     };
 
-
-
-
     QByteArray BIO2ByteArray(Bio &b) {
         int pending = BIO_ctrl_pending(b);
         QByteArray res(pending, '\0');