From 04c60744535a67cce158c840494dec941bef50f5 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Mon, 5 Aug 2024 11:05:14 +0800 Subject: [PATCH] fixup --- velox/type/tz/TimeZoneMap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/velox/type/tz/TimeZoneMap.cpp b/velox/type/tz/TimeZoneMap.cpp index 995df7c2974c7..fc1d3f13d6b23 100644 --- a/velox/type/tz/TimeZoneMap.cpp +++ b/velox/type/tz/TimeZoneMap.cpp @@ -62,16 +62,16 @@ TTimeZoneDatabase buildTimeZoneDatabase( // Every single other time zone entry (outside of offsets) needs to be // available in external/date or this will throw. else { + const date::time_zone* zone; try { - auto zone = date::locate_zone(entry.second); - timeZonePtr = - std::make_unique(entry.second, entry.first, zone); + zone = date::locate_zone(entry.second); } catch (std::runtime_error& err) { // Timezone not found in OS, skip it. LOG(WARNING) << "Timezone [" << entry.second << "] not found due to: '" << err.what() << "', ignoring it. "; continue; } + timeZonePtr = std::make_unique(entry.second, entry.first, zone); } tzDatabase[entry.first] = std::move(timeZonePtr); }