mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Variant: Converted from strtol/substr to std::stoi/std::compare
This commit is contained in:
parent
bdfd22ad88
commit
6df55c9156
1 changed files with 1 additions and 1 deletions
|
@ -1871,7 +1871,7 @@ void Variant::cast (const enum type new_type)
|
|||
_string == "0.0") ? false : true;
|
||||
break;
|
||||
case type_integer:
|
||||
_integer = (int) strtol (_string.c_str (), NULL, (_string.substr (0, 2) == "0x" ? 16 : 10));
|
||||
_integer = std::stoi (_string, NULL, (_string.compare (0, 2, "0x", 2) ? 10 : 16));
|
||||
break;
|
||||
case type_real: _real = std::stod (_string); break;
|
||||
case type_string: break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue