Skip to content

Commit

Permalink
fix SCP glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Jan 29, 2023
1 parent aebc43e commit 39d0682
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions treap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type node[T any] struct {
item T // generic key/value
}

// Tree must be initialized by [NewTree].
// Tree is the public handle, using it without initialization will panic.
type Tree[T any] struct {
root *node[T]
cmp func(T, T) (ll, rr, lr, rl int)
Expand Down Expand Up @@ -435,7 +435,7 @@ func (t Tree[T]) CoverSCP(item T) (result T, ok bool) {
result, ok = t.scp(l, item)

if !ok && m != nil {
return m.item, ok
return m.item, true
}

return result, ok
Expand Down

0 comments on commit 39d0682

Please sign in to comment.