diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-12 23:03:10 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-15 10:01:55 -0400 |
commit | ccccd5190898ece3ac17aa3178f320d091f221df (patch) | |
tree | 5788ed502c1de1eff00562a61edaa41f8aa8fafa /src/script/script.h | |
parent | 18f11fb24b47c6762e659b4bd3413f03e2c9ec99 (diff) | |
download | bitcoin-ccccd5190898ece3ac17aa3178f320d091f221df.tar.xz |
script: Remove undocumented and unused operator+
Diffstat (limited to 'src/script/script.h')
-rw-r--r-- | src/script/script.h | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/script/script.h b/src/script/script.h index dd2ab2f070..4902d66c1d 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -419,28 +419,15 @@ public: READWRITEAS(CScriptBase, *this); } - CScript& operator+=(const CScript& b) - { - reserve(size() + b.size()); - insert(end(), b.begin(), b.end()); - return *this; - } - - friend CScript operator+(const CScript& a, const CScript& b) - { - CScript ret = a; - ret += b; - return ret; - } - explicit CScript(int64_t b) { operator<<(b); } - explicit CScript(opcodetype b) { operator<<(b); } explicit CScript(const CScriptNum& b) { operator<<(b); } // delete non-existent constructor to defend against future introduction // e.g. via prevector explicit CScript(const std::vector<unsigned char>& b) = delete; + /** Delete non-existent operator to defend against future introduction */ + CScript& operator<<(const CScript& b) = delete; CScript& operator<<(int64_t b) { return push_int64(b); } @@ -487,15 +474,6 @@ public: return *this; } - CScript& operator<<(const CScript& b) - { - // I'm not sure if this should push the script or concatenate scripts. - // If there's ever a use for pushing a script onto a script, delete this member fn - assert(!"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!"); - return *this; - } - - bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>& vchRet) const { return GetScriptOp(pc, end(), opcodeRet, &vchRet); @@ -506,7 +484,6 @@ public: return GetScriptOp(pc, end(), opcodeRet, nullptr); } - /** Encode/decode small integers: */ static int DecodeOP_N(opcodetype opcode) { |