Skip to content

Commit

Permalink
use ShortString for VariableTimeZone name
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Apr 14, 2021
1 parent 7ba4d85 commit d2fdec9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
EzXML = "0.9.1, 1"
Mocking = "0.7"
RecipesBase = "0.7, 0.8, 1"
ShortStrings = "0.3.6"
ShortStrings = "0.3.7"
julia = "1"

[extras]
Expand Down
2 changes: 1 addition & 1 deletion src/TimeZones.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using Dates
using Printf
using Serialization
using RecipesBase: RecipesBase, @recipe
using ShortStrings: ShortString15
using ShortStrings: ShortString15, ShortString63
using Unicode

import Dates: TimeZone, UTC
Expand Down
6 changes: 5 additions & 1 deletion src/types/variabletimezone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ end

Base.isless(a::Transition, b::Transition) = isless(a.utc_datetime, b.utc_datetime)

# Ideally would always use ShortString63, but it's `hash` is broken on 32-bit systems.
# https://github.com/JuliaString/MurmurHash3.jl/issues/12
const VariableZoneName = Int === Int64 ? ShortString63 : String

"""
VariableTimeZone
A `TimeZone` with an offset that changes over time.
"""
struct VariableTimeZone <: TimeZone
name::String
name::VariableZoneName
transitions::Vector{Transition}
cutoff::Union{DateTime,Nothing}

Expand Down

0 comments on commit d2fdec9

Please sign in to comment.