createNode returns a newly initialized SkipListNode Object that implements the SkipListNode.
(level int, score SCORE, hash uint32, record *core.Record)
| 306 | |
| 307 | // createNode returns a newly initialized SkipListNode Object that implements the SkipListNode. |
| 308 | func createNode(level int, score SCORE, hash uint32, record *core.Record) *SkipListNode { |
| 309 | node := SkipListNode{ |
| 310 | hash: hash, |
| 311 | record: record, |
| 312 | score: score, |
| 313 | level: make([]SkipListLevel, level), |
| 314 | } |
| 315 | return &node |
| 316 | } |
| 317 | |
| 318 | // randomLevel returns a random level for the new skiplist node we are going to create. |
| 319 | // The return value of this function is between 1 and SkipListMaxLevel |
no outgoing calls
no test coverage detected