From d2b1cf51235a1b151c0a4c9ed3b668eecca7261c Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 13 Jan 2020 11:26:29 +0900 Subject: [PATCH] refactor: just use a constructor to remove conversions --- toml/parser.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toml/parser.hpp b/toml/parser.hpp index 7cf644a..dc8422d 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -792,13 +792,13 @@ parse_offset_datetime(location& loc) const auto str = ofs.unwrap().str(); if(str.front() == '+') { - offset.hour = static_cast(from_string(str.substr(1,2), 0)); - offset.minute = static_cast(from_string(str.substr(4,2), 0)); + offset = time_offset(from_string(str.substr(1,2), 0), + from_string(str.substr(4,2), 0)); } else { - offset.hour = -static_cast(from_string(str.substr(1,2), 0)); - offset.minute = -static_cast(from_string(str.substr(4,2), 0)); + offset = time_offset(-from_string(str.substr(1,2), 0), + -from_string(str.substr(4,2), 0)); } } else if(*inner_loc.iter() != 'Z' && *inner_loc.iter() != 'z')