From e374db22bc0edb47dba7704b33285405d7363f54 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Fri, 28 Apr 2017 15:49:22 +0200 Subject: [PATCH] Remove unused skiplist types --- block.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/block.go b/block.go index d6aff93b5..bda1859b8 100644 --- a/block.go +++ b/block.go @@ -19,7 +19,6 @@ import ( "io/ioutil" "os" "path/filepath" - "sort" "github.com/oklog/ulid" "github.com/pkg/errors" @@ -241,30 +240,3 @@ func (f *mmapFile) Close() error { } return err1 } - -// A skiplist maps offsets to values. The values found in the data at an -// offset are strictly greater than the indexed value. -type skiplist interface { - // offset returns the offset to data containing values of x and lower. - offset(x int64) (uint32, bool) -} - -// simpleSkiplist is a slice of plain value/offset pairs. -type simpleSkiplist []skiplistPair - -type skiplistPair struct { - value int64 - offset uint32 -} - -func (sl simpleSkiplist) offset(x int64) (uint32, bool) { - // Search for the first offset that contains data greater than x. - i := sort.Search(len(sl), func(i int) bool { return sl[i].value >= x }) - - // If no element was found return false. If the first element is found, - // there's no previous offset actually containing values that are x or lower. - if i == len(sl) || i == 0 { - return 0, false - } - return sl[i-1].offset, true -}