mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-05-05 14:17:50 +08:00
clean up *SkipListElementReference loaded from Redis
This commit is contained in:
parent
513fed323a
commit
947add39e6
@ -48,5 +48,15 @@ func (m *SkipListElementStore) LoadElement(id int64) (*skiplist.SkipListElement,
|
|||||||
}
|
}
|
||||||
t := &skiplist.SkipListElement{}
|
t := &skiplist.SkipListElement{}
|
||||||
err = proto.Unmarshal([]byte(data), t)
|
err = proto.Unmarshal([]byte(data), t)
|
||||||
|
if err == nil {
|
||||||
|
for i:=0;i<len(t.Next);i++{
|
||||||
|
if t.Next[i].IsNil() {
|
||||||
|
t.Next[i] = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if t.Prev.IsNil() {
|
||||||
|
t.Prev = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
return t, err
|
return t, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user