refactor: just use a constructor

to remove conversions
This commit is contained in:
ToruNiina 2020-01-13 11:26:29 +09:00
parent 9f92916d1d
commit d2b1cf5123

View File

@ -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')