Skip to content

Commit 2fb168b

Browse files
committed
Make iterators in CScript::FindAndDelete const
1 parent e625548 commit 2fb168b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/script/script.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,12 @@ class CScript : public CScriptBase
594594
if (b.empty())
595595
return nFound;
596596
CScript result;
597-
iterator pc = begin(), pc2 = begin();
597+
const_iterator pc = begin(), pc2 = begin(), end = this->end();
598598
opcodetype opcode;
599599
do
600600
{
601601
result.insert(result.end(), pc2, pc);
602-
while (static_cast<size_t>(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
602+
while (static_cast<size_t>(end - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))
603603
{
604604
pc = pc + b.size();
605605
++nFound;
@@ -609,7 +609,7 @@ class CScript : public CScriptBase
609609
while (GetOp(pc, opcode));
610610

611611
if (nFound > 0) {
612-
result.insert(result.end(), pc2, end());
612+
result.insert(result.end(), pc2, end);
613613
*this = result;
614614
}
615615

0 commit comments

Comments
 (0)