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. --- pssr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pssr.cpp') diff --git a/pssr.cpp b/pssr.cpp index b8863fce..753797ba 100644 --- a/pssr.cpp +++ b/pssr.cpp @@ -127,7 +127,7 @@ DecodingResult PSSR_MEM_Base::RecoverMessageFromRepresentative( // extract salt and recoverableMessage from DB = 00 ... || 01 || M || salt byte *salt = representative + representativeByteLength - u - digestSize - saltSize; - byte *M = std::find_if(representative, salt-1, std::bind2nd(std::not_equal_to(), byte(0))); + byte *M = FindIfNot(representative, salt-1, byte(0)); recoverableMessageLength = salt-M-1; if (*M == 0x01 && (size_t)(M - representative - (representativeBitLength % 8 != 0)) >= MinPadLen(digestSize) && -- cgit v1.2.1