Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ordered_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ end
function hash(s::OrderedSet, h::UInt)
h = hash(orderedset_seed, h)
s.dict.ndel > 0 && rehash!(s.dict)
hash(s.dict.keys, h)
h_2 = UInt(0)
for k in s.dict.keys
h_2 ⊻= hash(k, h)
end
h_2
end

# Deprecated functionality, see
Expand Down
2 changes: 1 addition & 1 deletion test/test_ordered_set.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using OrderedCollections, Test
s1 = OrderedSet{String}(["bar", "foo"])
s2 = OrderedSet{String}(["foo", "bar"])
s3 = OrderedSet{String}(["baz"])
@test hash(s1) != hash(s2)
@test hash(s1) == hash(s2)
@test hash(s1) != hash(s3)
end

Expand Down
Loading