aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2017-05-18 09:42:14 +0200
committerpracticalswift <practicalswift@users.noreply.github.com>2017-05-19 09:56:16 +0200
commit211adc074a662505f2b54f3f2755f4fefc167aac (patch)
tree75ae8f49fcd201cc359664317df049f04c78c41b /src/script
parentea6fde3f1d2694176a657b69fb0eeb5426e6f309 (diff)
Use range-based for loops (C++11) when looping over vector elements
Diffstat (limited to 'src/script')
-rw-r--r--src/script/interpreter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp
index f4e5313a78..1ba0f775bd 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();
}