summaryrefslogtreecommitdiff
path: root/ida.cpp
diff options
context:
space:
mode:
authorKirit Sælensminde <k@kirit.com>2018-01-12 20:38:56 +0700
committerJeffrey Walton <noloader@gmail.com>2018-01-12 08:38:56 -0500
commit59b94d2bbf43440790abd64d953a3c7f576c4ce3 (patch)
tree4a75ac0e14ea7d1d3a199bd863af0cfff7e909c9 /ida.cpp
parentc6289edd44815a0d42823e8c0f283fc25d7506de (diff)
downloadcryptopp-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 'ida.cpp')
-rw-r--r--ida.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ida.cpp b/ida.cpp
index 125ab979..615bf2f2 100644
--- a/ida.cpp
+++ b/ida.cpp
@@ -389,7 +389,7 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo
if (m_possiblePadding)
{
- size_t len = std::find_if(begin, end, std::bind2nd(std::not_equal_to<byte>(), byte(0))) - begin;
+ size_t len = FindIfNot(begin, end, byte(0)) - begin;
m_zeroCount += len;
begin += len;
if (begin == end)
@@ -402,7 +402,7 @@ size_t PaddingRemover::Put2(const byte *begin, size_t length, int messageEnd, bo
m_possiblePadding = false;
}
- const byte *x = std::find_if(RevIt(end), RevIt(begin), std::bind2nd(std::not_equal_to<byte>(), byte(0))).base();
+ const byte *x = FindIfNot(RevIt(end), RevIt(begin), byte(0)).base();
if (x != begin && *(x-1) == 1)
{
AttachedTransformation()->Put(begin, x-begin-1);