mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-04-05 20:52:50 +08:00
SkipListElementReference can be an empty object
This commit is contained in:
parent
280ab7f95c
commit
513fed323a
@ -34,8 +34,18 @@ func (t *SkipList) deleteElement(element *SkipListElement) error {
|
||||
}
|
||||
|
||||
func (t *SkipList) loadElement(ref *SkipListElementReference) (*SkipListElement, error) {
|
||||
if ref == nil {
|
||||
if ref.IsNil() {
|
||||
return nil, nil
|
||||
}
|
||||
return t.listStore.LoadElement(ref.ElementPointer)
|
||||
}
|
||||
|
||||
func (ref *SkipListElementReference) IsNil() bool {
|
||||
if ref == nil {
|
||||
return true
|
||||
}
|
||||
if len(ref.Key) == 0 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
Loading…
Reference in New Issue
Block a user