Skip to content

Commit

Permalink
Fix doc typo for PopMax()
Browse files Browse the repository at this point in the history
  • Loading branch information
Neal committed May 2, 2022
1 parent c00790f commit 18df6fe
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion btree.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (tr *BTree) PopMin() any {
return v
}

// PopMax removes the minimum item in tree and returns it.
// PopMax removes the maximum item in tree and returns it.
// Returns nil if the tree has no items.
func (tr *BTree) PopMax() any {
v, ok := tr.base.PopMax()
Expand Down
3 changes: 1 addition & 2 deletions generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ func (tr *Generic[T]) delete(cn **node[T], max bool, key T,
tr.nodeRebalance(n, i)
}
return prev, true

}

// nodeRebalance rebalances the child nodes following a delete operation.
Expand Down Expand Up @@ -769,7 +768,7 @@ func (tr *Generic[T]) PopMin() (T, bool) {
return tr.deleteHint(item, nil)
}

// PopMax removes the minimum item in tree and returns it.
// PopMax removes the maximum item in tree and returns it.
// Returns nil if the tree has no items.
func (tr *Generic[T]) PopMax() (T, bool) {
if tr.lock() {
Expand Down
3 changes: 1 addition & 2 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ func (tr *Map[K, V]) delete(pn **mapNode[K, V], max bool, key K,
tr.nodeRebalance(n, i)
}
return prev, true

}

// nodeRebalance rebalances the child nodes following a delete operation.
Expand Down Expand Up @@ -623,7 +622,7 @@ func (tr *Map[K, V]) PopMin() (K, V, bool) {
return tr.empty.key, tr.empty.value, false
}

// PopMax removes the minimum item in tree and returns it.
// PopMax removes the maximum item in tree and returns it.
// Returns nil if the tree has no items.
func (tr *Map[K, V]) PopMax() (K, V, bool) {
if tr.root == nil {
Expand Down
4 changes: 1 addition & 3 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,13 @@ func (tr *Set[K]) Max() (K, bool) {
func (tr *Set[K]) PopMin() (K, bool) {
key, _, ok := tr.base.PopMin()
return key, ok

}

// PopMax removes the minimum item in tree and returns it.
// PopMax removes the maximum item in tree and returns it.
// Returns nil if the tree has no items.
func (tr *Set[K]) PopMax() (K, bool) {
key, _, ok := tr.base.PopMax()
return key, ok

}

// GetAt returns the value at index.
Expand Down

0 comments on commit 18df6fe

Please sign in to comment.