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

Function newSkipList

sorted_set.go:335–344  ·  view source on GitHub ↗
(db *DB)

Source from the content-addressed store, hash-verified

333}
334
335func newSkipList(db *DB) *SkipList {
336 skipList := &SkipList{
337 db: db,
338 level: 1,
339 dict: make(map[uint32]*SkipListNode),
340 }
341 hash, _ := utils.GetFnv32([]byte(""))
342 skipList.header = createNode(SkipListMaxLevel, 0, hash, nil)
343 return skipList
344}
345
346func (sl *SkipList) cmp(r1 *core.Record, r2 *core.Record) int {
347 val1, _ := sl.db.getValueByRecord(r1)

Callers 1

ZAddMethod · 0.85

Calls 2

GetFnv32Function · 0.92
createNodeFunction · 0.85

Tested by

no test coverage detected