MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / PopMax

Method PopMax

sorted_set.go:506–512  ·  view source on GitHub ↗

PopMax returns and remove the element with maximum score, nil if the set is empty. Time complexity of this method is : O(log(N)).

()

Source from the content-addressed store, hash-verified

504//
505// Time complexity of this method is : O(log(N)).
506func (sl *SkipList) PopMax() *SkipListNode {
507 x := sl.tail
508 if x != nil {
509 sl.Remove(x.hash)
510 }
511 return x
512}
513
514// Put puts an element into the sorted set with specific key / value / score.
515//

Callers

nothing calls this directly

Calls 1

RemoveMethod · 0.95

Tested by

no test coverage detected