aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-04-04 08:26:07 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-04-13 09:06:35 -0700
commit2fb168b55d8e07a1df357040cd59c0a93d3ccb6a (patch)
tree97ee9ed2fc32a464e18d325083d01cbe037b0974
parente625548e7cae119ce555783a7a546f0039fc431b (diff)
Make iterators in CScript::FindAndDelete const
-rw-r--r--src/script/script.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/script.h b/src/script/script.h
index 59ceff247c..224785d999 100644
--- a/src/script/script.h
+++ b/src/script/script.h
@@ -594,12 +594,12 @@ public:
if (b.empty())
return nFound;
CScript result;
- iterator pc = begin(), pc2 = begin();
+ const_iterator pc = begin(), pc2 = begin(), end = this->end();
opcodetype opcode;
do
{
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();
++nFound;
@@ -609,7 +609,7 @@ public:
while (GetOp(pc, opcode));
if (nFound > 0) {
- result.insert(result.end(), pc2, end());
+ result.insert(result.end(), pc2, end);
*this = result;
}