MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / createNode

Function createNode

sorted_set.go:308–316  ·  view source on GitHub ↗

createNode returns a newly initialized SkipListNode Object that implements the SkipListNode.

(level int, score SCORE, hash uint32, record *core.Record)

Source from the content-addressed store, hash-verified

306
307// createNode returns a newly initialized SkipListNode Object that implements the SkipListNode.
308func 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

Callers 2

newSkipListFunction · 0.85
insertNodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected