MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / newZSetNodes

Function newZSetNodes

structure/zset.go:170–176  ·  view source on GitHub ↗

newZSetNodes is a function that creates a new FZSet object and returns a pointer to it. It initializes the dictionary member dict of the newly created object to an empty map. The map is intended to map strings to pointers of ZSetValue objects. size member of the object is set to 0, indicating that t

()

Source from the content-addressed store, hash-verified

168// size member of the object is set to 0, indicating that the FZSet object is currently empty.
169// The skipList member of the object is set to a new SkipList object created by calling `newSkipList()` function.
170func newZSetNodes() *FZSet {
171 return &FZSet{
172 dict: make(map[string]*ZSetValue),
173 size: 0,
174 skipList: newSkipList(),
175 }
176}
177
178// newSkipList is a function that creates an instance of a SkipList struct object and returns a pointer to it.
179// This involves initializing the level of the SkipList to 1 and creating a new SkipListNode object as the head of the list.

Callers 4

TestSortedSetFunction · 0.85
TestSkipList_deleteFunction · 0.85
getOrCreateZSetMethod · 0.85

Calls 1

newSkipListFunction · 0.85

Tested by 3

TestSortedSetFunction · 0.68
TestSkipList_deleteFunction · 0.68