From: Stephan Beyer Date: Tue, 7 Jul 2020 07:31:01 +0000 (+0200) Subject: Use default member init for PKeyCtx::_ctx and PKey::_pkey X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~100 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ed570d6274cabf25b78e0a6feada1821093eaa4a;p=nextcloud-desktop.git Use default member init for PKeyCtx::_ctx and PKey::_pkey Signed-off-by: Stephan Beyer --- diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index 78874a92c..c7cf7a5bd 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -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');