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
()
| 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. |
| 170 | func 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. |