Skip to content

Commit

Permalink
change RLock to Lock for MutableTree.VersionExists (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
yun-yeo authored and robert-zaremba committed Dec 1, 2021
1 parent 72b6c23 commit 19a5dde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func (tree *MutableTree) IsEmpty() bool {

// VersionExists returns whether or not a version exists.
func (tree *MutableTree) VersionExists(version int64) bool {
tree.mtx.RLock()
defer tree.mtx.RUnlock()
tree.mtx.Lock()
defer tree.mtx.Unlock()

if tree.allRootLoaded {
return tree.versions[version]
Expand Down

0 comments on commit 19a5dde

Please sign in to comment.