diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-10-06 22:01:17 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-10-06 22:01:19 -0700 |
| commit | f3d8232e1424e2e1ff9b2de695a05b58ef3f92b7 (patch) | |
| tree | 998d12d6d4d4c1d211d23b90cf38b57ec744c0b7 /weed/util | |
| parent | 03bb82043c3fd7be6ee419a443081524809eb5d0 (diff) | |
| download | seaweedfs-f3d8232e1424e2e1ff9b2de695a05b58ef3f92b7.tar.xz seaweedfs-f3d8232e1424e2e1ff9b2de695a05b58ef3f92b7.zip | |
reduce one redis lookup on hot path
Diffstat (limited to 'weed/util')
| -rw-r--r-- | weed/util/skiplist/skiplist.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/util/skiplist/skiplist.go b/weed/util/skiplist/skiplist.go index f42ec23cd..2a0262c69 100644 --- a/weed/util/skiplist/skiplist.go +++ b/weed/util/skiplist/skiplist.go @@ -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! |
