diff options
| author | Pieter Wuille <[email protected]> | 2017-05-23 13:58:35 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-05-23 14:08:20 -0700 |
| commit | f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad (patch) | |
| tree | 2bb524079ce9233098fb60589b6f2a7f848a47e1 /src/script/interpreter.cpp | |
| parent | Merge #9539: [net] Avoid initialization to a value that is never read (diff) | |
| parent | Use range-based for loops (C++11) when looping over vector elements (diff) | |
| download | discoin-f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad.tar.xz discoin-f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad.zip | |
Merge #10347: Use range-based for loops (C++11) when looping over vector elements
211adc0 Use range-based for loops (C++11) when looping over vector elements (practicalswift)
Tree-SHA512: 0e007f20dcef99d3c7a1036265e00f689d69f42e02fd82dd8389f45b52d31947e5f9388de2610d3d9bd9f554915ce0d35ebce561e5ae3a9013956d0ee4937145
Diffstat (limited to 'src/script/interpreter.cpp')
| -rw-r--r-- | src/script/interpreter.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index f4e5313a7..1ba0f775b 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1142,24 +1142,24 @@ public: uint256 GetPrevoutHash(const CTransaction& txTo) { CHashWriter ss(SER_GETHASH, 0); - for (unsigned int n = 0; n < txTo.vin.size(); n++) { - ss << txTo.vin[n].prevout; + for (const auto& txin : txTo.vin) { + ss << txin.prevout; } return ss.GetHash(); } uint256 GetSequenceHash(const CTransaction& txTo) { CHashWriter ss(SER_GETHASH, 0); - for (unsigned int n = 0; n < txTo.vin.size(); n++) { - ss << txTo.vin[n].nSequence; + for (const auto& txin : txTo.vin) { + ss << txin.nSequence; } return ss.GetHash(); } uint256 GetOutputsHash(const CTransaction& txTo) { CHashWriter ss(SER_GETHASH, 0); - for (unsigned int n = 0; n < txTo.vout.size(); n++) { - ss << txTo.vout[n]; + for (const auto& txout : txTo.vout) { + ss << txout; } return ss.GetHash(); } |