Skip to content

Commit abd624e

Browse files
committed
add ! after _join, mutating function
1 parent 89d6924 commit abd624e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/splay_tree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ end
109109
# This is a two-step process.
110110
# In the first step, splay the largest node in S. This moves the largest node to the root node.
111111
# In the second step, set the right child of the new root of S to T.
112-
function _join(tree::SplayTree, s::Union{SplayTreeNode, Nothing}, t::Union{SplayTreeNode, Nothing})
112+
function _join!(tree::SplayTree, s::Union{SplayTreeNode, Nothing}, t::Union{SplayTreeNode, Nothing})
113113
if s === nothing
114114
return t
115115
elseif t === nothing
@@ -173,7 +173,7 @@ function Base.delete!(tree::SplayTree{K}, d::K) where K
173173
s.leftChild.parent = nothing
174174
end
175175

176-
tree.root = _join(tree, s.leftChild, t)
176+
tree.root = _join!(tree, s.leftChild, t)
177177
tree.count -= 1
178178
return tree
179179
end

0 commit comments

Comments
 (0)