本文整理匯總了Golang中github.com/Workiva/go-datastructures/slice/skip.SkipList.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang SkipList.Get方法的具體用法?Golang SkipList.Get怎麽用?Golang SkipList.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/Workiva/go-datastructures/slice/skip.SkipList
的用法示例。
在下文中一共展示了SkipList.Get方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: deleteRecursive
// deleteRecursive is used by the delete logic. The recursion depth
// only goes as far as the number of dimensions, so this shouldn't be an
// issue.
func (rt *skipListRT) deleteRecursive(sl *skip.SkipList, dimension uint64,
entry rangetree.Entry) rangetree.Entry {
value := entry.ValueAtDimension(dimension)
if isLastDimension(dimension, rt.dimensions) {
entries := sl.Delete(skipEntry(value))
if entries[0] == nil {
return nil
}
rt.number--
return entries[0].(*lastBundle).entry
}
db, ok := sl.Get(skipEntry(value))[0].(*dimensionalBundle)
if !ok { // value was not found
return nil
}
result := rt.deleteRecursive(db.sl, dimension+1, entry)
if result == nil {
return nil
}
if db.sl.Len() == 0 {
sl.Delete(db)
}
return result
}