mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-22 04:20:06 +00:00
refactor: just use a constructor
to remove conversions
This commit is contained in:
parent
9f92916d1d
commit
d2b1cf5123
@ -792,13 +792,13 @@ parse_offset_datetime(location<Container>& loc)
|
||||
const auto str = ofs.unwrap().str();
|
||||
if(str.front() == '+')
|
||||
{
|
||||
offset.hour = static_cast<std::int8_t>(from_string<int>(str.substr(1,2), 0));
|
||||
offset.minute = static_cast<std::int8_t>(from_string<int>(str.substr(4,2), 0));
|
||||
offset = time_offset(from_string<int>(str.substr(1,2), 0),
|
||||
from_string<int>(str.substr(4,2), 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
offset.hour = -static_cast<std::int8_t>(from_string<int>(str.substr(1,2), 0));
|
||||
offset.minute = -static_cast<std::int8_t>(from_string<int>(str.substr(4,2), 0));
|
||||
offset = time_offset(-from_string<int>(str.substr(1,2), 0),
|
||||
-from_string<int>(str.substr(4,2), 0));
|
||||
}
|
||||
}
|
||||
else if(*inner_loc.iter() != 'Z' && *inner_loc.iter() != 'z')
|
||||
|
Loading…
Reference in New Issue
Block a user