Skip to content

Commit e4aa1f7

Browse files
committed
refactor: Replace use of atoi64 in core_read
Replace use of atoi64 and circuitois way to test if something is a valid 64-bit integer, with the use of our own function `ParseInt64`.
1 parent 6992e0d commit e4aa1f7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core_read.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ CScript ParseScript(const std::string& s)
5050

5151
for (std::vector<std::string>::const_iterator w = words.begin(); w != words.end(); ++w)
5252
{
53+
int64_t n;
5354
if (w->empty())
5455
{
5556
// Empty string, ignore. (boost::split given '' will return one word)
5657
}
57-
else if (std::all_of(w->begin(), w->end(), ::IsDigit) ||
58-
(w->front() == '-' && w->size() > 1 && std::all_of(w->begin()+1, w->end(), ::IsDigit)))
58+
else if (ParseInt64(*w, &n))
5959
{
6060
// Number
61-
int64_t n = atoi64(*w);
6261
result << n;
6362
}
6463
else if (w->substr(0,2) == "0x" && w->size() > 2 && IsHex(std::string(w->begin()+2, w->end())))

0 commit comments

Comments
 (0)