Make iterators in CScript::FindAndDelete const
This commit is contained in:
parent
e625548e7c
commit
2fb168b55d
1 changed files with 3 additions and 3 deletions
|
@ -594,12 +594,12 @@ public:
|
||||||
if (b.empty())
|
if (b.empty())
|
||||||
return nFound;
|
return nFound;
|
||||||
CScript result;
|
CScript result;
|
||||||
iterator pc = begin(), pc2 = begin();
|
const_iterator pc = begin(), pc2 = begin(), end = this->end();
|
||||||
opcodetype opcode;
|
opcodetype opcode;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
result.insert(result.end(), pc2, pc);
|
result.insert(result.end(), pc2, pc);
|
||||||
while (static_cast<size_t>(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
|
while (static_cast<size_t>(end - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
|
||||||
{
|
{
|
||||||
pc = pc + b.size();
|
pc = pc + b.size();
|
||||||
++nFound;
|
++nFound;
|
||||||
|
@ -609,7 +609,7 @@ public:
|
||||||
while (GetOp(pc, opcode));
|
while (GetOp(pc, opcode));
|
||||||
|
|
||||||
if (nFound > 0) {
|
if (nFound > 0) {
|
||||||
result.insert(result.end(), pc2, end());
|
result.insert(result.end(), pc2, end);
|
||||||
*this = result;
|
*this = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue