Skip to content

Commit

Permalink
Replace memcmp with std::equal in CScript::FindAndDelete
Browse files Browse the repository at this point in the history
Function is stl; std::equal just makes more sense.
  • Loading branch information
romanornr committed Jan 9, 2017
1 parent 126df74 commit a369575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class CScript : public std::vector<unsigned char>
do
{
result.insert(result.end(), pc2, pc);
while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0)
while (static_cast<size_t>(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
{
pc = pc + b.size();
++nFound;
Expand Down

0 comments on commit a369575

Please sign in to comment.