@@ -59,17 +59,17 @@ CScript ParseScript(const std::string& s)
59
59
std::vector<std::string> words;
60
60
boost::algorithm::split (words, s, boost::algorithm::is_any_of (" \t\n " ), boost::algorithm::token_compress_on);
61
61
62
- for (std::vector<std:: string>::const_iterator w = words. begin (); w != words. end (); ++w )
62
+ for (const std::string& w : words)
63
63
{
64
- if (w-> empty ())
64
+ if (w. empty ())
65
65
{
66
66
// Empty string, ignore. (boost::split given '' will return one word)
67
67
}
68
- else if (std::all_of (w-> begin (), w-> end (), ::IsDigit) ||
69
- (w-> front () == ' -' && w-> size () > 1 && std::all_of (w-> begin ()+1 , w-> end (), ::IsDigit)))
68
+ else if (std::all_of (w. begin (), w. end (), ::IsDigit) ||
69
+ (w. front () == ' -' && w. size () > 1 && std::all_of (w. begin ()+1 , w. end (), ::IsDigit)))
70
70
{
71
71
// Number
72
- int64_t n = LocaleIndependentAtoi<int64_t >(* w);
72
+ int64_t n = LocaleIndependentAtoi<int64_t >(w);
73
73
74
74
// limit the range of numbers ParseScript accepts in decimal
75
75
// since numbers outside -0xFFFFFFFF...0xFFFFFFFF are illegal in scripts
@@ -80,23 +80,23 @@ CScript ParseScript(const std::string& s)
80
80
81
81
result << n;
82
82
}
83
- else if (w-> substr (0 ,2 ) == " 0x" && w-> size () > 2 && IsHex (std::string (w-> begin ()+2 , w-> end ())))
83
+ else if (w. substr (0 ,2 ) == " 0x" && w. size () > 2 && IsHex (std::string (w. begin ()+2 , w. end ())))
84
84
{
85
85
// Raw hex data, inserted NOT pushed onto stack:
86
- std::vector<unsigned char > raw = ParseHex (std::string (w-> begin ()+2 , w-> end ()));
86
+ std::vector<unsigned char > raw = ParseHex (std::string (w. begin ()+2 , w. end ()));
87
87
result.insert (result.end (), raw.begin (), raw.end ());
88
88
}
89
- else if (w-> size () >= 2 && w-> front () == ' \' ' && w-> back () == ' \' ' )
89
+ else if (w. size () >= 2 && w. front () == ' \' ' && w. back () == ' \' ' )
90
90
{
91
91
// Single-quoted string, pushed as data. NOTE: this is poor-man's
92
92
// parsing, spaces/tabs/newlines in single-quoted strings won't work.
93
- std::vector<unsigned char > value (w-> begin ()+1 , w-> end ()-1 );
93
+ std::vector<unsigned char > value (w. begin ()+1 , w. end ()-1 );
94
94
result << value;
95
95
}
96
96
else
97
97
{
98
98
// opcode, e.g. OP_ADD or ADD:
99
- result << ParseOpCode (* w);
99
+ result << ParseOpCode (w);
100
100
}
101
101
}
102
102
0 commit comments