diff options
author | Kirit Sælensminde <k@kirit.com> | 2018-01-12 20:38:56 +0700 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2018-01-12 08:38:56 -0500 |
commit | 59b94d2bbf43440790abd64d953a3c7f576c4ce3 (patch) | |
tree | 4a75ac0e14ea7d1d3a199bd863af0cfff7e909c9 /pssr.cpp | |
parent | c6289edd44815a0d42823e8c0f283fc25d7506de (diff) | |
download | cryptopp-git-59b94d2bbf43440790abd64d953a3c7f576c4ce3.tar.gz |
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.
Diffstat (limited to 'pssr.cpp')
-rw-r--r-- | pssr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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>(), 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) &&
|