diff --git a/tz.h b/tz.h index 0f09350..26b7768 100644 --- a/tz.h +++ b/tz.h @@ -1155,7 +1155,6 @@ to_sys_time(const utc_time& ut) { using namespace std::chrono; using duration = typename std::common_type::type; - auto const& leaps = get_tzdb().leaps; auto ls = is_leap_second(ut); auto tp = sys_time{ut.time_since_epoch() - ls.second}; if (ls.first) @@ -1181,14 +1180,11 @@ to_stream(std::basic_ostream& os, const CharT* fmt, using CT = typename common_type::type; const string abbrev("UTC"); CONSTDATA seconds offset{0}; - auto const& leaps = get_tzdb().leaps; - year_month_day ymd; - time_of_day time; auto ls = is_leap_second(t); auto tp = sys_time{t.time_since_epoch() - ls.second}; auto const sd = floor(tp); - ymd = sd; - time = make_time(tp - sd); + year_month_day ymd = sd; + auto time = make_time(tp - sd); time.seconds() += seconds{ls.first}; fields fds{ymd, time}; to_stream(os, fmt, fds, &abbrev, &offset);