Skip to content

Commit

Permalink
Type stability in hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Aug 4, 2023
1 parent 2fa8ecd commit 86bf750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ in(item, tree::Node) = any(t -> t == item, tree)
length(tree::Node) = sum(Returns(1), tree)
function hash(tree::Node{T}) where {T}
return tree_mapreduce(
t -> hash(t.constant ? (0, t.val::T) : (1, t.feature)),
t -> t.constant ? hash((0, t.val::T)) : hash((1, t.feature)),
t -> hash((t.degree + 1, t.op)),
(n...) -> hash(n),
tree,
Expand Down

0 comments on commit 86bf750

Please sign in to comment.