reduce one redis lookup on hot path

This commit is contained in:
Chris Lu
2021-10-06 22:01:17 -07:00
parent 03bb82043c
commit f3d8232e14
2 changed files with 16 additions and 18 deletions

View File

@@ -467,6 +467,9 @@ func (t *SkipList) GetSmallestNode() (*SkipListElement, error) {
func (t *SkipList) GetLargestNode() (*SkipListElement, error) {
return t.LoadElement(t.EndLevels[0])
}
func (t *SkipList) GetLargestNodeReference() (*SkipListElementReference) {
return t.EndLevels[0]
}
// Next returns the next element based on the given node.
// Next will loop around to the first node, if you call it on the last!