Skip to content

Commit 7c030f7

Browse files
committed
Use AutoHashEquals.jl
1 parent 5836e54 commit 7c030f7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/core.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,19 @@ function get_code(s::Status)
6464
return TF_Code(code)
6565
end
6666

67-
struct DevicePart{IndexType}
67+
@auto_hash_equals struct DevicePart{IndexType}
6868
kind::Vector{String}
6969
index::IndexType
7070
end
7171

7272
device_index_from_zero(part::DevicePart{Int}) = "$(join(part.kind, ":")):$(part.index-1)"
7373
device_index_from_zero(part::DevicePart) = "$(join(part.kind, ":")):$(part.index)"
7474

75-
==(a::DevicePart, b::DevicePart) = a.kind == b.kind && a.index == b.index
76-
77-
struct Device
75+
@auto_hash_equals struct Device
7876
parts::Vector{DevicePart}
7977
end
8078

8179
Device() = Device(DevicePart[])
82-
==(a::Device, b::Device) = a.parts == b.parts
8380

8481
function DevicePart(s::AbstractString)
8582
parts = split(s, ":")

0 commit comments

Comments
 (0)