mirror of
https://github.com/facebook/duckling.git
synced 2024-11-29 01:03:44 +03:00
Use HashMap.lookupDefault
Summary: This is a small stylystic improvement. Reviewed By: patapizza Differential Revision: D4713463 fbshipit-source-id: 47720d3
This commit is contained in:
parent
1edf62f347
commit
1a251d8e42
@ -45,7 +45,7 @@ import Duckling.Types
|
||||
makeReftime :: HashMap Text TimeZoneSeries -> Text -> UTCTime -> DucklingTime
|
||||
makeReftime series tz utcTime = DucklingTime $ ZoneSeriesTime ducklingTime tzs
|
||||
where
|
||||
tzs = fromMaybe (TimeZoneSeries utc []) $ HashMap.lookup tz series
|
||||
tzs = HashMap.lookupDefault (TimeZoneSeries utc []) tz series
|
||||
ducklingTime = toUTC $ utcToLocalTime' tzs utcTime
|
||||
|
||||
-- | Builds a `DucklingTime` for timezone `tz` at current time.
|
||||
|
Loading…
Reference in New Issue
Block a user