Skip to content

Commit

Permalink
Tag: Return unique empty tag
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Jan 13, 2024
1 parent 8508088 commit b6293d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ struct Tag
tags::Dict{Type,Any}
Tag(tags...) =
new(Dict{Type,Any}(tags...))
Tag(::Nothing) = new(Dict{Type,Any}())
end
const EMPTY_TAG = Tag(nothing)
Tag() = EMPTY_TAG
Base.getindex(tag::Tag, ::Type{device}) where {device<:StorageDevice} =
get(tag.tags, device, nothing)

Expand Down

0 comments on commit b6293d5

Please sign in to comment.