From 59b94d2bbf43440790abd64d953a3c7f576c4ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirit=20S=C3=A6lensminde?= Date: Fri, 12 Jan 2018 20:38:56 +0700 Subject: C++17 compatible lambda expressions to replace `bind2nd` (#559) * Conditionally use a lambda rather than the older `bind2nd` style. * Duplicate the if statements. * Centralise the conditional compilation to an implementation of find_if_not. * Refactoring of name and code placement after review. * Use `FindIfNot` where appropriate. * Remove whitespace. --- oaep.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'oaep.cpp') diff --git a/oaep.cpp b/oaep.cpp index 08d75a99..fb9e31a0 100644 --- a/oaep.cpp +++ b/oaep.cpp @@ -82,7 +82,7 @@ DecodingResult OAEP_Base::Unpad(const byte *oaepBlock, size_t oaepBlockLen, byte // DB = pHash' || 00 ... || 01 || M byte *M = std::find(maskedDB+hLen, maskedDB+dbLen, 0x01); invalid = (M == maskedDB+dbLen) || invalid; - invalid = (std::find_if(maskedDB+hLen, M, std::bind2nd(std::not_equal_to(), byte(0))) != M) || invalid; + invalid = (FindIfNot(maskedDB+hLen, M, byte(0)) != M) || invalid; invalid = !pHash->VerifyDigest(maskedDB, encodingParameters.begin(), encodingParameters.size()) || invalid; if (invalid) -- cgit v1.2.1