From 9203f40f41e4a735d379d13867d277c696fb28c5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 3 Sep 2022 22:52:53 +0100 Subject: Fix some warnings noticed by the readability-* clang-tidy checkers. --- src/modules/m_pbkdf2.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/modules/m_pbkdf2.cpp') diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 3811ccff8..259f326ad 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -66,11 +66,9 @@ public: return ConvToStr(this->iterations) + ":" + Base64::Encode(this->hash) + ":" + Base64::Encode(this->salt); } - bool IsValid() + bool IsValid() const { - if (!this->iterations || !this->length || this->salt.empty() || this->hash.empty()) - return false; - return true; + return this->iterations && this->length && !this->salt.empty() && !this->hash.empty(); } }; @@ -82,7 +80,7 @@ public: unsigned long iterations; size_t dkey_length; - std::string PBKDF2(const std::string& pass, const std::string& salt, unsigned long itr = 0, size_t dkl = 0) + std::string PBKDF2(const std::string& pass, const std::string& salt, unsigned long itr = 0, size_t dkl = 0) const { size_t blocks = std::ceil((double)dkl / provider->out_size); -- cgit v1.3.1-10-gc9f91