Skip to content

Commit 47d8ccf

Browse files
committed
Implemented hashing. Closes #77
1 parent b38c4c1 commit 47d8ccf

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ComponentArrays"
22
uuid = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
33
authors = ["Jonnie Diegelman <47193959+jonniedie@users.noreply.github.com>"]
4-
version = "0.9.3"
4+
version = "0.9.4"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/componentarray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ Base.propertynames(x::ComponentVector) = propertynames(indexmap(getaxes(x)[1]))
284284

285285
Base.keys(x::ComponentVector) = keys(indexmap(getaxes(x)[1]))
286286

287+
Base.hash(x::ComponentArray, h::UInt) = hash(getdata(x), h)
288+
287289
"""
288290
valkeys(x::ComponentVector)
289291

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ end
107107

108108
@test keys(ca) == (:a, :b, :c)
109109
@test valkeys(ca) == Val.((:a, :b, :c))
110+
111+
@test ca == getdata(ca)
112+
@test hash(ca) == hash(getdata(ca))
113+
@test hash(ca, zero(UInt)) == hash(getdata(ca), zero(UInt))
110114
end
111115

112116
@testset "Get" begin

0 commit comments

Comments
 (0)