newSkipListNodeValue is a function that constructs and returns a new ZSetValue. It takes a score (int), a key (string), and a value (interface{}) as parameters. These parameters serve as the initial state of the ZSetValue upon its creation.
(score int, member string, value interface{})
| 209 | // It takes a score (int), a key (string), and a value (interface{}) as parameters. |
| 210 | // These parameters serve as the initial state of the ZSetValue upon its creation. |
| 211 | func newSkipListNodeValue(score int, member string, value interface{}) *ZSetValue { |
| 212 | // Create a new instance of a ZSetValue with the provided score, key, and value. |
| 213 | node := &ZSetValue{ |
| 214 | score: score, |
| 215 | member: member, |
| 216 | value: value, |
| 217 | } |
| 218 | |
| 219 | // Return the newly created ZSetValue. |
| 220 | return node |
| 221 | } |
| 222 | |
| 223 | // insert is a method of the SkipList type that is used to insert a new node into the skip list. It takes as arguments |
| 224 | // the score (int), key (string) and a value (interface{}), and returns a pointer to the ZSetValue struct. The method |