/* Internal function used by delete, DeleteByScore and DeleteByRank */
Internal function used by delete, DeleteByScore and DeleteByRank
/ * Internal function used by delete DeleteByScore and DeleteByRank * /
func (this *SortedSet) deleteNode(x *SortedSetNode, update [SKIPLIST_MAXLEVEL]*SortedSetNode) {
	for i := 0; i < this.level; i++ {
		if update[i].level[i].forward == x {
			update[i].level[i].span += x.level[i].span - 1
			update[i].level[i].forward = x.level[i].forward
		} else {
			update[i].level[i].span -= 1
		}
	}
	if x.level[0].forward != nil {
		x.level[0].forward.backward = x.backward
	} else {
		this.tail = x.backward
	}
	for this.level > 1 && this.header.level[this.level-1].forward == nil {
		this.level--
	}
	this.length--
	oldNode, ok := this.dict[x.key]
	if ok {
		delete(this.dict, x.key)
		oldNode.Reset()
		this.nodePool.Put(oldNode)
	}
}
func ( this * SortedSet ) deleteNode ( x * SortedSetNode , update [ SKIPLIST_MAXLEVEL ] * SortedSetNode ) { for i := 0 ; i < this . level ; i ++ { if update [ i ] . level [ i ] . forward == x { update [ i ] . level [ i ] . span += x . level [ i ] . span - 1 update [ i ] . level [ i ] . forward = x . level [ i ] . forward } else { update [ i ] . level [ i ] . span -= 1 } } if x . level [ 0 ] . forward != nil { x . level [ 0 ] . forward . backward = x . backward } else { this . tail = x . backward } for this . level > 1 && this . header . level [ this . level - 1 ] . forward == nil { this . level -- } this . length -- oldNode , ok := this . dict [ x . key ] if ok { delete ( this . dict , x . key ) oldNode . Reset ( ) this . nodePool . Put ( oldNode ) } }
Internal function used by delete, DeleteByScore and DeleteByRank
Internal function used by delete DeleteByScore and DeleteByRank